mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Add some documentation
This commit is contained in:
parent
2bcc022fdf
commit
a2f4c98fa1
1 changed files with 8 additions and 0 deletions
|
|
@ -119,6 +119,9 @@ class LogEntry(models.Model):
|
|||
|
||||
@property
|
||||
def changes_dict(self):
|
||||
"""
|
||||
Return the changes recorded in this log entry as a dictionary object.
|
||||
"""
|
||||
try:
|
||||
return json.loads(self.changes)
|
||||
except ValueError:
|
||||
|
|
@ -126,6 +129,11 @@ class LogEntry(models.Model):
|
|||
|
||||
@property
|
||||
def changes_str(self, colon=': ', arrow=u' \u2192 ', separator='; '):
|
||||
"""
|
||||
Return the changes recorded in this log entry as a string. The formatting of the string can be customized by
|
||||
setting alternate values for colon, arrow and separator. If the formatting is still not satisfying, please use
|
||||
changes_dict() and format the string yourself.
|
||||
"""
|
||||
substrings = []
|
||||
|
||||
for field, values in self.changes_dict.iteritems():
|
||||
|
|
|
|||
Loading…
Reference in a new issue