Skip to content

Commit

Permalink
Adds a how-to recipe for subscribing to a specific object
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaoming committed Dec 13, 2023
1 parent ab4d58f commit 91e3fcc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/howto/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ users can also be subscribed to specific object (i.e. "*your* comment was update
notify(_("OMG! Something happened"), EVENT_KEY, target_object=my_model_instance)
In order to subscribe a user to receive notifications only for a specific object,
you can create the subscription like this:

.. code-block:: python
subscribe(
user_setting,
EVENT_KEY,
content_type=ContentType.objects.get_for_model(MyModel),
object_id=my_model_instance.id,
)
Excluding certain recipients
----------------------------
Expand Down

0 comments on commit 91e3fcc

Please sign in to comment.