Changes between Version 1 and Version 2 of Ticket #33366, comment 11
- Timestamp:
- Dec 16, 2021, 1:56:13 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33366, comment 11
v1 v2 5 5 If we want to address the noop `AlterField` migration being generated for all usages of placeholders in `related_name` there's two way we can do that. 6 6 7 1. Augment the documentation to mention under which circumstances such `AlterField` operations can be created and mention that it is safe to adjust historic migrations to use the proper ''placeholder'' syntax to prevent it from happe ing (it's safe even if your library supports Django < 4.0 as well because the models were rendered and thus `related_name` were evaluated at field binding time).7 1. Augment the documentation to mention under which circumstances such `AlterField` operations can be created and mention that it is safe to adjust historic migrations to use the proper ''placeholder'' syntax to prevent it from happening (it's safe even if your library supports Django < 4.0 as well because the models were rendered and thus `related_name` were evaluated at field binding time). 8 8 2. Adjust the auto-detector to consider `'app_model` and `'%(app_label)s_%(class)s'` equals (in the context of a `app.Model` model) to prevent changes from being detected. This will have the unfortunate side effect to prevent changes of a field from harcoded to placeholders based `related_name` to be detected by the framework which could be considered a limitation of the previous approach model rendering based approach. 9 9