On Tue, 2006-08-08 at 12:13 +0100, Bill de hÓra wrote: > Malcolm Tredinnick wrote: > > > For now, if you want to hack on the source for your initial > > testing/debugging, have a look in django/core/management.py around line > > 206. There's a line that says > > > > r_name = '%s_refs_%s_%x' % (r_col, col, abs(hash((r_table, > > table)))) > > > > (it's the only place we use hash() in the code in that file, so search > > for that word). Change this to anything you like that will make your > > backend happy. That will tide you over until we can get a more > > reasonable solution in place. > > Being able to read the DATABASE_ENGINE from management.py would help. > Can it be picked by importing django.conf.settings, or is there some > other thing you need to do?
Hmmm. It will work. I see one place in management.py where we are not explicitly importing settings (in get_sql_create()). However, I know that some of the calls in that function will result in settings being imported. For example, importing django.db forces settings to be instantiated. So we might as well just bite the bullet and import it in the right place (making sure execute_from_command_line() can still set up the environ). In case it's not clear, we have quantum settings: observing (accessing) them changes things. Importing django.conf.settings does not actually set anything up. It's only when you first try to access a setting that we work out whether they have been manually configured (via settings.configure()) or if we should use the DJANGO_SETTINGS_MODULE environment variable. I'm beginning to really dislike databases, particularly this portion of them. Ticket #2493 popped up the other day and it is going a long way towards convincing me that all the good intentions in the world about trying to have well-name constraints is for naught. We're ultimately doomed in the "trying to be nice" department. Cheers, 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 -~----------~----~----~----~------~----~------~--~---

