#7856: custom_sql_for_model incorrectly parses the sql file for advanced sql
statements
-------------------------------------+--------------------------------------
Reporter: thebitguru | Owner: nobody
Status: closed | Milestone:
Component: Core framework | Version: SVN
Resolution: wontfix | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------+--------------------------------------
Changes (by mtredinnick):
* status: new => closed
* needs_better_patch: => 0
* resolution: => wontfix
* needs_tests: => 0
* needs_docs: => 0
Comment:
We don't intend to put a full SQL parser into Django, which is what would
be required to handle all of these cases smoothly, So this is a case of
"don't do that".
If you really need to insert such complex SQL, then register a signal
handler for syncdb and write Python code to do the insert yourself. Django
supports simple SQL statements (think "no embedded semicolon" as one
guideline, but there are other edge-cases as well) and multiple such
statements in a file (so we have to split them up, since not all DB
backends can handle multiple statements in one call). Since our goal is to
be an 85% solution covering all the common cases and making other cases
possible (through the syncdb signal), the fact that we can't parse the
above is unfortunate, but not tragic.
--
Ticket URL: <http://code.djangoproject.com/ticket/7856#comment:1>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---