Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

magic-removal: Fixed #1440 -- Changed django.core.management not to e…

…xecute multiple SQL statements in the same cursor.execute(). Thanks, Malcolm Tredinnick

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2467 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2695d52f504f0389cdb25d098aad859599a2e6fe 1 parent 6dd46eb
Adrian Holovaty authored March 02, 2006
1  AUTHORS
@@ -101,6 +101,7 @@ answer newbie questions, and generally made Django that much better:
101 101
     Aaron Swartz <http://www.aaronsw.com/>
102 102
     Tom Tobin
103 103
     Joe Topjian <http://joe.terrarum.net/geek/code/python/django/>
  104
+    Malcolm Tredinnick
104 105
     Amit Upadhyay
105 106
     Milton Waddams
106 107
     Rachel Willmer <http://www.willmer.com/kb/>
8  django/core/management.py
@@ -418,17 +418,17 @@ def syncdb():
418 418
             created_models.add(model)
419 419
             pending_references.update(references)
420 420
             sql.extend(_get_sql_for_pending_references(model, pending_references))
421  
-            sql = "\n".join(sql)
422 421
             print "Creating table %s" % model._meta.db_table
423  
-            cursor.execute(sql)
  422
+            for statement in sql:
  423
+                cursor.execute(statement)
424 424
 
425 425
         for model in model_list:
426 426
             if model in created_models:
427 427
                 sql = _get_many_to_many_sql_for_model(model)
428 428
                 if sql:
429  
-                    sql = '\n'.join(sql).strip()
430 429
                     print "Creating many-to-many tables for %s model" % model.__name__
431  
-                    cursor.execute(sql)
  430
+                    for statement in sql:
  431
+                        cursor.execute(statement)
432 432
 
433 433
     transaction.commit_unless_managed()
434 434
 syncdb.args = ''

0 notes on commit 2695d52

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