Opened 8 years ago

Closed 7 years ago

#1388 closed defect (fixed)

[magic-removal] [patch] Old-style DB API fixes (manipulators, generic views)

Reported by: russell@… Owned by: jacob
Component: Generic views Version: magic-removal
Severity: normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:



Some misc fixes in magic-removal for some old-style DB API usage that is still present:

--- magic-removal/django/views/generic/    2006-02-23 10:36:34.000000000 +0200
+++ magic-removal/django/views/generic/ 2006-02-23 10:33:13.000000000 +0200
@@ -96,7 +96,7 @@
         raise AttributeError("Generic edit view must be called with either an object_id or a slug/ slug_field")
-        object = model._default_manager.get_object(**lookup_kwargs)
+        object = model._default_manager.model.objects.get(**lookup_kwargs)
     except ObjectDoesNotExist:
         raise Http404, "No %s found for %s" % (model._meta.verbose_name, lookup_kwargs)

--- magic-removal/django/db/models/     2006-02-23 10:42:43.000000000 +0200
+++ magic-removal/django/db/models/      2006-02-23 10:42:43.000000000 +0200
@@ -120,7 +120,7 @@
                         new_vals = new_data.get(, ())
                         new_vals = new_data.getlist(
-                    was_changed = getattr(new_object, 'set_%s' %
+                    was_changed = getattr(new_object, '%s' %
                     if self.change and was_changed:


Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by Paul Bx <pb@…>

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

These appear to have been fixed at some point.

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.