summaryrefslogtreecommitdiff
path: root/django/models
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-10-19 01:09:05 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-10-19 01:09:05 +0000
commitf07e5d4f5df5ca9ca3366d7ecc4b01c490c13198 (patch)
tree1b73d89471554d058cb46bc13d17bd3687c638fa /django/models
parentfd3d579179581b1fa460e13115471d58fec0c8f6 (diff)
Fixed #627 -- BACKWARDS-INCOMPATIBLE CHANGE. Admin is now an app, not a middleware. See BackwardsIncompatibleChanges for a full list of changes and information on how to update your code.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@948 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/models')
-rw-r--r--django/models/auth.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/django/models/auth.py b/django/models/auth.py
index 20d846157e..2a65290085 100644
--- a/django/models/auth.py
+++ b/django/models/auth.py
@@ -176,49 +176,3 @@ class Message(meta.Model):
def __repr__(self):
return self.message
-
-class LogEntry(meta.Model):
- action_time = meta.DateTimeField(auto_now=True)
- user = meta.ForeignKey(User)
- content_type = meta.ForeignKey(core.ContentType, blank=True, null=True)
- object_id = meta.TextField(blank=True, null=True)
- object_repr = meta.CharField(maxlength=200)
- action_flag = meta.PositiveSmallIntegerField()
- change_message = meta.TextField(blank=True)
- class META:
- module_name = 'log'
- verbose_name_plural = 'log entries'
- db_table = 'auth_admin_log'
- ordering = ('-action_time',)
- module_constants = {
- 'ADDITION': 1,
- 'CHANGE': 2,
- 'DELETION': 3,
- }
-
- def __repr__(self):
- return str(self.action_time)
-
- def is_addition(self):
- return self.action_flag == ADDITION
-
- def is_change(self):
- return self.action_flag == CHANGE
-
- def is_deletion(self):
- return self.action_flag == DELETION
-
- def get_edited_object(self):
- "Returns the edited object represented by this log entry"
- return self.get_content_type().get_object_for_this_type(pk=self.object_id)
-
- def get_admin_url(self):
- """
- Returns the admin URL to edit the object represented by this log entry.
- This is relative to the Django admin index page.
- """
- return "%s/%s/%s/" % (self.get_content_type().package, self.get_content_type().python_module_name, self.object_id)
-
- def _module_log_action(user_id, content_type_id, object_id, object_repr, action_flag, change_message=''):
- e = LogEntry(None, None, user_id, content_type_id, object_id, object_repr[:200], action_flag, change_message)
- e.save()