Skip to content

Commit

Permalink
update docs (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsiniscoding authored Aug 1, 2024
1 parent 2958f58 commit 07a3a83
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ A DetailView utilizing the LogAccessMixin could look like the following example:
# View code goes here
You can also add log-access to function base views, as the following example illustrates:

.. code-block:: python
from auditlog.signals import accessed
def profile_view(request, pk):
## get the object you want to log access
user = User.objects.get(pk=pk)
## log access
accessed.send(user.__class__, instance=user)
# View code goes here
...
**Excluding fields**

Expand Down

0 comments on commit 07a3a83

Please sign in to comment.