Ticket #7778: model_subclass_deletion.diff
File model_subclass_deletion.diff, 782 bytes (added by , 16 years ago) |
---|
-
django/db/models/query.py
834 834 update_query = sql.UpdateQuery(cls, connection) 835 835 for field in cls._meta.fields: 836 836 if field.rel and field.null and field.rel.to in seen_objs: 837 update_query.clear_related(field, pk_list) 837 # Only clear a related field if the field's column really exists in the related class. 838 if filter(lambda r_field:r_field.column == field.column, field.rel.to._meta.fields): 839 update_query.clear_related(field, pk_list) 838 840 839 841 # Now delete the actual data. 840 842 for cls in ordered_classes: