Commits

Rod Morison committed 0b80a84 Draft

updated patch on django ticket 12728 for django 1.4.3

Comments (0)

Files changed (1)

requirements/patches/django.ticket-12728.patch

---- lib/python2.7/site-packages/django.orig/db/backends/__init__.py	2012-12-18 00:44:27.000000000 -0800
-+++ lib/python2.7/site-packages/django/db/backends/__init__.py	2012-12-18 01:17:51.276110288 -0800
-@@ -973,7 +973,7 @@
-                     # If this is an m2m using an intermediate table,
-                     # we don't need to reset the sequence.
-                     if f.rel.through is None:
--                        sequence_list.append({'table': f.m2m_db_table(), 'column': None})
-+                        sequence_list.append({'table': f.m2m_db_table(), 'column': f.m2m_reverse_name()})
- 
-         return sequence_list
- 
-diff -u -r django.orig/db/backends/postgresql_psycopg2/operations.py django/db/backends/postgresql_psycopg2/operations.py
---- lib/python2.7/site-packages/django.orig/db/backends/postgresql_psycopg2/operations.py	2012-12-18 00:44:27.000000000 -0800
-+++ lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/operations.py	2012-12-18 01:19:19.120545886 -0800
+--- lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/operations.py.orig	2013-02-10 10:41:22.477658703 -0800
++++ lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/operations.py	2013-02-10 10:42:25.977655398 -0800
 @@ -133,12 +133,13 @@
                      break # Only one AutoField is allowed per model, so don't bother continuing.
              for f in model._meta.many_to_many:
                  if not f.rel.through:
 +                    pk_column = f.m2m_reverse_name()
-                     output.append("%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;" %                          (style.SQL_KEYWORD('SELECT'),
+                     output.append("%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;" % \
+                         (style.SQL_KEYWORD('SELECT'),
                          style.SQL_TABLE(qn(f.m2m_db_table())),
 -                        style.SQL_FIELD('id'),
 -                        style.SQL_FIELD(qn('id')),