Changes between Initial Version and Version 1 of Ticket #33366, comment 11


Ignore:
Timestamp:
Dec 16, 2021, 1:56:00 PM (3 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33366, comment 11

    initial v1  
    55If 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.
    66
    7 1. Augment the documentation to mention under which circumstances such `AlterField` operations can be created and mention that it is safe to adjust history migrations to use the proper ''placeholder'' syntax to prevent it from happeing (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).
     71. 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 happeing (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).
    882. 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.
    99
Back to Top