Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2196 -- Fixed AttributeError in method_set_order. Thanks, fonso

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3220 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 54e5b9aa21736859d7d8899cbeda9fe91aee6e4f 1 parent 5d7af7b
Adrian Holovaty authored June 28, 2006

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. 8  django/db/models/base.py
8  django/db/models/base.py
@@ -399,10 +399,10 @@ def method_set_order(ordered_obj, self, id_list):
399 399
     cursor = connection.cursor()
400 400
     # Example: "UPDATE poll_choices SET _order = %s WHERE poll_id = %s AND id = %s"
401 401
     sql = "UPDATE %s SET %s = %%s WHERE %s = %%s AND %s = %%s" % \
402  
-        (backend.quote_name(ordered_obj.db_table), backend.quote_name('_order'),
403  
-        backend.quote_name(ordered_obj.order_with_respect_to.column),
404  
-        backend.quote_name(ordered_obj.pk.column))
405  
-    rel_val = getattr(self, ordered_obj.order_with_respect_to.rel.field_name)
  402
+        (backend.quote_name(ordered_obj._meta.db_table), backend.quote_name('_order'),
  403
+        backend.quote_name(ordered_obj._meta.order_with_respect_to.column),
  404
+        backend.quote_name(ordered_obj._meta.pk.column))
  405
+    rel_val = getattr(self, ordered_obj._meta.order_with_respect_to.rel.field_name)
406 406
     cursor.executemany(sql, [(i, rel_val, j) for i, j in enumerate(id_list)])
407 407
     transaction.commit_unless_managed()
408 408
 

0 notes on commit 54e5b9a

Please sign in to comment.
Something went wrong with that request. Please try again.