#10074: Can't delete objects with lazy GenericRelations
------------------------------------------+---------------------------------
Reporter: clay | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: 1.0
Keywords: genericrelation delete | Stage: Unreviewed
Has_patch: 0 |
------------------------------------------+---------------------------------
Models with GenericRelation fields defined as:
the_relation = generic.GenericRelation('Related')
produce objects that cannot be deleted:
>>> obj.delete()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "lib/django/db/models/base.py", line 463, in delete
delete_objects(seen_objs)
File "lib/django/db/models/query.py", line 867, in delete_objects
del_query.delete_batch_related(pk_list)
File "lib/django/db/models/sql/subqueries.py", line 61, in
delete_batch_related
field = f.rel.to._meta.get_field(f.content_type_field_name)
AttributeError: 'str' object has no attribute '_meta'
--
Ticket URL: <http://code.djangoproject.com/ticket/10074>
Django <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
-~----------~----~----~----~------~----~------~--~---