Changes between Initial Version and Version 1 of Ticket #34807


Ignore:
Timestamp:
Aug 31, 2023, 2:40:00 PM (15 months ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34807

    • Property Severity NormalRelease blocker
    • Property Triage Stage UnreviewedAccepted
  • Ticket #34807 – Description

    initial v1  
    11circular import between forms and models and choices.
    22
    3 before 500e01073adda32d514962 you could import forms just fine.
     3before [500e01073adda32d514962] you could import forms just fine.
    44
    55{{{
     
    1010
    1111
    12 but since 500e01073adda32d514962 this hasn't worked due to circular import.
     12but since [500e01073adda32d514962] this hasn't worked due to circular import.
    1313
    1414{{{
     
    6262Models has always had a dependency on Forms, but now Models depends on Forms depends on `utils.choices` which depend on `models.enums.ChoicesMeta`
    6363
    64 Summary of the circle: `django.forms` -> 'forms.widgets` -> `django.utils.choices` -> `django.db.models.enums` -> `models.__init__` -> `models.aggregates` -> `models.fields` -> `django.forms`
     64Summary of the circle: `django.forms` -> `forms.widgets` -> `django.utils.choices` -> `django.db.models.enums` -> `models.__init__` -> `models.aggregates` -> `models.fields` -> `django.forms`.
    6565
    66 If `django.db.models` is imported before forms then it happens to import fine because the order of imports happens to lines up perfectally, but it's very very fragile. `models.__init__` -> `models.aggregates` -> `models.fields`  -> `django.forms` -> 'forms.widgets` -> `django.utils.choices` -> `django.db.models.enums`.
     66If `django.db.models` is imported before forms then it happens to import fine because the order of imports happens to lines up perfectally, but it's very very fragile. `models.__init__` -> `models.aggregates` -> `models.fields`  -> `django.forms` -> `forms.widgets` -> `django.utils.choices` -> `django.db.models.enums`.
    6767
    6868
Back to Top