Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #2452: comments can now be put within initial SQL files. Thanks…

…, Pawel J. Sawicki.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4040 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit dabf0366044e053e5577c096b19d1d7d2bebfe9a 1 parent 3a0733e
Jacob Kaplan-Moss jacobian authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  django/core/management.py
2  django/core/management.py
View
@@ -349,6 +349,8 @@ def get_sql_initial_data_for_model(model):
if os.path.exists(sql_file):
fp = open(sql_file, 'U')
for statement in statements.split(fp.read()):
+ # Remove any comments from the file
+ statement = re.sub(r"--.*[\n\Z]", "", statement)
if statement.strip():
output.append(statement + ";")
fp.close()
Please sign in to comment.
Something went wrong with that request. Please try again.