On 1/17/07, Jazz <[EMAIL PROTECTED]> wrote:
....
As you can see, it triggers an "unterminated dollar-quoted string"
error.  After further investigation, this seems to be related to ticket
#3214, which is so far unresolved.


Yeah, the code that's breaking is in django.core.management; it's not
backend specific, though the reason it's breaking is statement
splitting since "# Some backends can't execute more than one SQL
statement at a time".

As a quick hack to get going, the attached may work for you.  It just
runs the whole file as a single .execute rather than fiddling with
multiple statement splitting.

But the short version is that get_sql_initial_data_for_model is not
written with languages other than pure SQL in mind.

...
Can anyone guess why this works OK for "telenieko", but not for me?

No.  :-/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Index: django/core/management.py
===================================================================
--- django/core/management.py   (revision 4343)
+++ django/core/management.py   (working copy)
@@ -348,7 +348,7 @@
    for sql_file in sql_files:
        if os.path.exists(sql_file):
            fp = open(sql_file, 'U')
-            for statement in statements.split(fp.read()):
+            for statement in [fp.read()]:
                # Remove any comments from the file
                statement = re.sub(r"--.*[\n\Z]", "", statement)
                if statement.strip():

Reply via email to