Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored November 07, 2006

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

  1. 2  django/core/management.py
2  django/core/management.py
@@ -349,6 +349,8 @@ def get_sql_initial_data_for_model(model):
349 349
         if os.path.exists(sql_file):
350 350
             fp = open(sql_file, 'U')
351 351
             for statement in statements.split(fp.read()):
  352
+                # Remove any comments from the file
  353
+                statement = re.sub(r"--.*[\n\Z]", "", statement)
352 354
                 if statement.strip():
353 355
                     output.append(statement + ";")
354 356
             fp.close()

0 notes on commit dabf036

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