Opened 15 years ago
Closed 15 years ago
#12245 closed (fixed)
m2m-refactor: r11724 broke model definitions outside of a "models" module (e.g. in tests)
Description ¶
While not documented, it was possible to declare a model in tests.py (by explicitly setting app_label
).
Since r11724 create_many_to_many_intermediary_model()
assumes a module called models
. This breaks test models that contain m2m fields. And thus requires a solution (or workaround) for #7835.
I'd suggest setting app_label
for auto created models instead of scanning the module name.
Change History (2)
by , 15 years ago
Attachment: | 12245.m2m_intermediary_app_label.diff added |
---|
comment:1 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [11755]) Fixed #12245 -- Corrected target app handling for auto-generated m2m models when the parent model isn't in the models module (or a subpackage thereof). Thanks to emulbreh for the report and patch.