Skip to content

Commit

Permalink
Update documentation to show that inheriting from BulkTrackerQuerySet…
Browse files Browse the repository at this point in the history
… is optional
  • Loading branch information
hassaanalansary committed May 28, 2023
1 parent 439b573 commit cea9c3d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ and single operations:
- ``save() # update and create``
- ``delete()``

all you need to do is to define your queryset and inherit from::
all you need to do is to define your Model and inherit from::

from bulk_tracker.models import BulkTrackerModel

class Author(BulkTrackerModel):
first_name = models.CharField(max_length=200)
last_name = models.CharField(max_length=200)

OR if you have a custom queryset inherit from or Don't want to support single-operation::

from bulk_tracker.managers import BulkTrackerQuerySet

class MyModelQuerySet(BulkTrackerQuerySet):
pass
def do_something_custom(self):
pass


now you can listen to the signals ``post_update_signal``, ``post_create_signal``, ``post_delete_signal``::
Expand Down Expand Up @@ -113,14 +122,14 @@ Complete Example
::

# managers.py
from bulk_tracker.managers import BulkTrackerQuerySet
from bulk_tracker.managers import BulkTrackerQuerySet # optional


class MyModelQuerySet(BulkTrackerQuerySet):
pass


class MyModelManager(BulkTrackerManager.from_queryset(MyModelQuerySet)):
class MyModelManager(BulkTrackerManager.from_queryset(MyModelQuerySet)): # optional
pass

::
Expand Down

0 comments on commit cea9c3d

Please sign in to comment.