Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#1313 closed defect (fixed)

[patch] removed use of klass from admin/ and get_object from db/models/fields/

Reported by: jpaulofarias at gmail dot com Owned by: Adrian Holovaty
Component: contrib.admin Version: magic-removal
Severity: normal Keywords: admin, db
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Removed those two usages and replaced klass with model and get_object with get.

Index: django/contrib/admin/
--- django/contrib/admin/	(revision 2216)
+++ django/contrib/admin/	(working copy)
@@ -9,7 +9,7 @@
 class LogEntryManager(models.Manager):
     def log_action(self, user_id, content_type_id, object_id, object_repr, action_flag, change_message=''):
-        e = self.klass(None, None, user_id, content_type_id, object_id, object_repr[:200], action_flag, change_message)
+        e = self.model(None, None, user_id, content_type_id, object_id, object_repr[:200], action_flag, change_message)
 class LogEntry(models.Model):
Index: django/db/models/fields/
--- django/db/models/fields/	(revision 2216)
+++ django/db/models/fields/	(working copy)
@@ -32,7 +32,7 @@
     "Validates that the value is unique for this field."
     lookup_type = f.get_validator_unique_lookup_type()
-        old_obj = self.manager.get_object(**{lookup_type: field_data})
+        old_obj = self.manager.get(**{lookup_type: field_data})
     except ObjectDoesNotExist:
     if getattr(self, 'original_object', None) and self.original_object._get_pk_val() == old_obj._get_pk_val():

Change History (2)

comment:1 Changed 12 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [2218]) magic-removal: Fixed #1313 -- Bugfixes for magic-removal. Thanks, jpaulofarias

comment:2 Changed 11 years ago by Adrian Holovaty

milestone: Version 0.91

Milestone Version 0.91 deleted

Note: See TracTickets for help on using tickets.
Back to Top