diff --git a/.gitignore b/.gitignore index 4002ae3..26466f3 100644 --- a/.gitignore +++ b/.gitignore @@ -87,3 +87,4 @@ ENV/ # Rope project settings .ropeproject .idea +.DS_Store diff --git a/easyaudit/models.py b/easyaudit/models.py index 65b3a3c..fff6614 100644 --- a/easyaudit/models.py +++ b/easyaudit/models.py @@ -52,6 +52,10 @@ def is_update(self): def is_delete(self): return self.DELETE == self.event_type + + def get_edited_object(self): + """ Return the edited object represented by this CRUD event (Like Django LogEntry does). """ + return self.content_type.get_object_for_this_type(pk=self.object_id) class Meta: verbose_name = _('CRUD event')