Code

Ticket #2809: models_update2.diff

File models_update2.diff, 793 bytes (added by Rockallite, 8 years ago)

[patch] Here's another scheme: use CharField type for storing referenced keys in string form. Is it possible for databases other than SQL Server?

Line 
1Index: django/contrib/admin/models.py
2===================================================================
3--- django/contrib/admin/models.py      (revision 3812)
4+++ django/contrib/admin/models.py      (working copy)
5@@ -16,7 +16,7 @@
6     action_time = models.DateTimeField(_('action time'), auto_now=True)
7     user = models.ForeignKey(User)
8     content_type = models.ForeignKey(ContentType, blank=True, null=True)
9-    object_id = models.TextField(_('object id'), blank=True, null=True)
10+    object_id = models.CharField(_('object id'), maxlength=100, blank=True, null=True)
11     object_repr = models.CharField(_('object repr'), maxlength=200)
12     action_flag = models.PositiveSmallIntegerField(_('action flag'))
13     change_message = models.TextField(_('change message'), blank=True)