Ticket #1308: models.py.diff
File models.py.diff, 1.3 KB (added by , 19 years ago) |
---|
-
models.py
9 9 10 10 class LogEntryManager(models.Manager): 11 11 def log_action(self, user_id, content_type_id, object_id, object_repr, action_flag, change_message=''): 12 e = self. klass(None, None, user_id, content_type_id, object_id, object_repr[:200], action_flag, change_message)12 e = self.model(None, None, user_id, content_type_id, object_id, object_repr[:200], action_flag, change_message) 13 13 e.save() 14 14 15 15 class LogEntry(models.Model): … … 41 41 42 42 def get_edited_object(self): 43 43 "Returns the edited object represented by this log entry" 44 return self. get_content_type().get_object_for_this_type(pk=self.object_id)44 return self.content_type.get_object_for_this_type(pk=self.object_id) 45 45 46 46 def get_admin_url(self): 47 47 """ 48 48 Returns the admin URL to edit the object represented by this log entry. 49 49 This is relative to the Django admin index page. 50 50 """ 51 return "%s/%s/%s/" % (self. get_content_type().get_package(), self.get_content_type().python_module_name, self.object_id)51 return "%s/%s/%s/" % (self.content_type.package, self.content_type.python_module_name, self.object_id)