Ticket #1308: models.py.diff

File models.py.diff, 1.3 KB (added by mookai, 19 years ago)
  • models.py

     
    99
    1010class LogEntryManager(models.Manager):
    1111    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)
    1313        e.save()
    1414
    1515class LogEntry(models.Model):
     
    4141
    4242    def get_edited_object(self):
    4343        "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)
    4545
    4646    def get_admin_url(self):
    4747        """
    4848        Returns the admin URL to edit the object represented by this log entry.
    4949        This is relative to the Django admin index page.
    5050        """
    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)
Back to Top