You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

signals.rst 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. =======
  2. Signals
  3. =======
  4. Oscar implements a number of custom signals that provide useful hook-points for
  5. adding functionality.
  6. product_viewed
  7. --------------
  8. .. class:: oscar.apps.catalogue.signals.product_viewed
  9. Raised when a product detail page is viewed.
  10. Arguments sent with this signal:
  11. .. attribute:: product
  12. The product being viewed
  13. .. attribute:: user
  14. The user in question
  15. .. attribute:: request
  16. The request instance
  17. .. attribute:: response
  18. The response instance
  19. product_search
  20. --------------
  21. .. class:: oscar.apps.catalogue.signals.product_search
  22. Raised when a search is performed.
  23. Arguments sent with this signal:
  24. .. attribute:: query
  25. The search term
  26. .. attribute:: user
  27. The user in question
  28. basket_addition
  29. ---------------
  30. .. class:: oscar.apps.basket.signals.basket_addition
  31. Raised when a product is added to a basket
  32. Arguments sent with this signal:
  33. .. attribute:: product
  34. The product being added
  35. .. attribute:: user
  36. The user in question
  37. voucher_addition
  38. ----------------
  39. .. class:: oscar.apps.basket.signals.voucher_addition
  40. Raised when a valid voucher is added to a basket
  41. Arguments sent with this signal:
  42. .. attribute:: basket
  43. The basket in question
  44. .. attribute:: voucher
  45. The voucher in question
  46. pre_payment
  47. -----------
  48. .. class:: oscar.apps.checkout.signals.pre_payment
  49. Raised immediately before attempting to take payment in the checkout.
  50. Arguments sent with this signal:
  51. .. attribute:: view
  52. The view class instance
  53. post_payment
  54. ------------
  55. .. class:: oscar.apps.checkout.signals.post_payment
  56. Raised immediately after payment has been taken.
  57. Arguments sent with this signal:
  58. .. attribute:: view
  59. The view class instance
  60. order_placed
  61. ------------
  62. .. class:: oscar.apps.order.signals.order_placed
  63. Raised by the :class:`oscar.apps.order.utils.OrderCreator` class when
  64. creating an order.
  65. Arguments sent with this signal:
  66. .. attribute:: order
  67. The order created
  68. .. attribute:: user
  69. The user creating the order (not necessarily the user linked to the order
  70. instance!)
  71. post_checkout
  72. -------------
  73. .. class:: oscar.apps.checkout.signals.post_checkout
  74. Raised by the :class:`oscar.apps.checkout.mixins.OrderPlacementMixin` class
  75. when a customer completes the checkout process
  76. .. attribute:: order
  77. The order created
  78. .. attribute:: user
  79. The user who completed the checkout
  80. .. attribute:: request
  81. The request instance
  82. .. attribute:: response
  83. The response instance
  84. review_created
  85. --------------
  86. .. class:: oscar.apps.catalogue.reviews.signals.review_added
  87. Raised when a product detail page is viewed.
  88. Arguments sent with this signal:
  89. .. attribute:: review
  90. The review that was created
  91. .. attribute:: user
  92. The user performing the action
  93. .. attribute:: request
  94. The request instance
  95. .. attribute:: response
  96. The response instance