Waylan Limberg wrote:
>> Do any of you know if there's a way to tell Django to specify "on
> cascade delete" for foreign key references, when it creates DB tables?
> 
> I don't believe you can. However, you can use sql or sqlall [1] to
> output the table creation sql to a file for editing.  For example:
> 
> manage.py sqlall myapp > myapp.sql

I was looking at this, but:  Does anyone know why "manage.py sqlall" 
rearranges the order of the table-creates from what's in the models?

I can't find the reason for the new ordering; it looks kind of random, 
and it causes the table-creates to fail because of foreign key constraints.



> 
> Then open myapp.sql in your favorite editor and alter the sql as you
> see fit. After saving, feed that file into your db.
> 
> [1]: 
> http://www.djangoproject.com/documentation/django_admin/#sql-appname-appname
>> I'm developing an application that is mostly using Django to touch my
>> DB, but that defines some SQL stored-procedures for manipulation of some
>> of its data by other clients.  I'd like the db-level "on cascade delete"
>> defined for these cases.
>>
>> Thanks,
>> Greg
>>
>>
> 
> 


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to