On Tue, 2007-02-13 at 16:51 +0100, Bram - Smartelectronix wrote: > Hi, > > > with the preprocessing that's being done on 'initial' SQL before adding > it to the DB I'm getting into trouble with the stored procedures I would > like to add to the DB (for the model in question). > > The backend specific SQL gets treated the same way. > > I think it's impossible to change the regular expression to take care of > this special case. > > Any ideas?
At the moment, the only workaround is to call out to your own shell script (or other) to do the insert. If you have a look around line 506 of django/core/management.py, you can see where Django emits a "post-syncdb" signal after setting up the database, so you can register a handler for that before calling the setup routines and then do your own stuff afterwards (include an os.system() or equivalent call). See [1] for an example of how to use this signal -- although that link isn't responding for me right now; hopefully it's just being temperamental. [1] http://www.bright-green.com/blog/2006_07_12/initialising_application_data_.html In the medium-term, I'd like to fix the initial SQL handling, but it's as trivial as it looks because of differing quoting requirements and the fact that not all the database shells can be used without user input (one easy to see case is trying to make a PostgreSQL database with a password work via psql without requiring user interaction). It might be fixed "properly" one day, or we may just have to document its limitations. Trying to write the be-all-and-end-all of database shell interfaces is probably not worth the effort and maintenance for us unless it's really easy. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---

