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 3.6KB

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