Code

Opened 8 years ago

Closed 8 years ago

#1361 closed defect (fixed)

[patch] magic-removal: manipulators.py using model modules

Reported by: Ian@… Owned by: adrian
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

these fix compile errors when adding things via the admin area.

Helios:/src/django_src/django/db/models ianh$ svn diff
Index: manipulators.py
===================================================================
--- manipulators.py     (revision 2309)
+++ manipulators.py     (working copy)
@@ -291,9 +291,8 @@
             kwargs['%s__pk' % f.name] = field_val
         else:
             kwargs['%s__iexact' % f.name] = field_val
-    mod = opts.get_model_module()
     try:
-        old_obj = mod.get_object(**kwargs)
+        old_obj = self.manager.get(**kwargs)
     except ObjectDoesNotExist:
         return
     if hasattr(self, 'original_object') and self.original_object._get_pk_val() == old_obj._get_pk_val():
@@ -318,7 +317,7 @@
     if lookup_type == 'date':
         lookup_kwargs['%s__day' % date_field.name] = date_val.day
     try:
-        old_obj = self.manager.get_object(**lookup_kwargs)
+        old_obj = self.manager.get(**lookup_kwargs)
     except ObjectDoesNotExist:
         return
     else:

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by jim-django@…

  • Summary changed from magik: fix manipulators to [patch] magic-removal: manipulators.py using model modules

comment:2 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [2318]) magic-removal: Fixed #1361 -- Fixed old-style DB API usage in db/models/manipulators.py. Thanks, Ian Holsman

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.