Permalink
Browse files

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...
1 parent 6dd46eb commit 2695d52f504f0389cdb25d098aad859599a2e6fe @adrianholovaty adrianholovaty committed Mar 2, 2006
Showing with 5 additions and 4 deletions.
  1. +1 −0 AUTHORS
  2. +4 −4 django/core/management.py
View
1 AUTHORS
@@ -101,6 +101,7 @@ answer newbie questions, and generally made Django that much better:
Aaron Swartz <http://www.aaronsw.com/>
Tom Tobin
Joe Topjian <http://joe.terrarum.net/geek/code/python/django/>
+ Malcolm Tredinnick
Amit Upadhyay
Milton Waddams
Rachel Willmer <http://www.willmer.com/kb/>
View
8 django/core/management.py
@@ -418,17 +418,17 @@ def syncdb():
created_models.add(model)
pending_references.update(references)
sql.extend(_get_sql_for_pending_references(model, pending_references))
- sql = "\n".join(sql)
print "Creating table %s" % model._meta.db_table
- cursor.execute(sql)
+ for statement in sql:
+ cursor.execute(statement)
for model in model_list:
if model in created_models:
sql = _get_many_to_many_sql_for_model(model)
if sql:
- sql = '\n'.join(sql).strip()
print "Creating many-to-many tables for %s model" % model.__name__
- cursor.execute(sql)
+ for statement in sql:
+ cursor.execute(statement)
transaction.commit_unless_managed()
syncdb.args = ''

0 comments on commit 2695d52

Please sign in to comment.