Ticket #356 (closed defect: worksforme)
Deleting GenericRelation / Support ignoring fields
|Reported by:||elsdoerfer@…||Owned by:||andrew|
If a GenericRelation? is removed, it will be added to the migration as delete_column. Adding a GenericRelation? is handled properly however - this is because code to specifically ignore those fields exists for processing new fields, but not for field removal, nor if a field is changed (when changing a GenericRelation?, you get "Detected change to the target model of M2M field 'xyz'. South can't handle this; leaving this change out.". While this works fine, the warning is unnecessary and confusing.
While this would be simple enough to fix, I would like to offer a different suggestion: Extend the model introspection syntax to allow fields to ask to be ignored.
For example, I have a custom field that is similar to GenericRelation?, and fortunately, it subclasses it, so the deletion/modification bug above notwithstanding, the current approach would work for me. But there might be some cases in which subclassing is not an option.
This would not be a problem if, instead of special-casing GenericRelation?, one could simply configure the field to be ignored.
Possibly, this would even allow then freezing stuff like GenericForeignKey?.
- Status changed from new to closed
- Resolution set to worksforme
- Status changed from closed to reopened
- Resolution worksforme deleted