We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2958f58 commit 07a3a83Copy full SHA for 07a3a83
docs/source/usage.rst
@@ -55,6 +55,22 @@ A DetailView utilizing the LogAccessMixin could look like the following example:
55
56
# View code goes here
57
58
+You can also add log-access to function base views, as the following example illustrates:
59
+
60
+.. code-block:: python
61
62
+ from auditlog.signals import accessed
63
64
+ def profile_view(request, pk):
65
+ ## get the object you want to log access
66
+ user = User.objects.get(pk=pk)
67
68
+ ## log access
69
+ accessed.send(user.__class__, instance=user)
70
71
+ # View code goes here
72
+ ...
73
74
75
**Excluding fields**
76
0 commit comments