#3549: Models that use GenericRelation generate multiple drop statements in
./manage.sql reset app
-----------------------------------+----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: new | Component: django-admin.py
Version: SVN | Keywords: GenericRelation reset
sqlreset ./manage.py
Stage: Unreviewed | Has_patch: 0
-----------------------------------+----------------------------------------
If a model X explicitly defines a GenericRelation to act as the reverse
end of a GenericForeignKey from model Y, then the sql generated by
./manage.py reset game will generate an extra DROP TABLE app_Y for each
GenericRelation.
I believe the cause is in django.core.management.get_sql_delete, in the
many-to-many section around line 307 or so. Model X apparently treats a
GenericRelation(Y) as a ManyToManyField(Y) here. This might be
appropriate (I don't know), but either way collecting these tables in the
set() created above would uniquefy them and solve the issue.
--
Ticket URL: <http://code.djangoproject.com/ticket/3549>
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
-~----------~----~----~----~------~----~------~--~---