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)

Reported by: Johannes Dollinger Owned by: nobody
Component: Uncategorized Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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.

Attachments (1)

12245.m2m_intermediary_app_label.diff (1.2 KB ) - added by Johannes Dollinger 15 years ago.

Download all attachments as: .zip

Change History (2)

by Johannes Dollinger, 15 years ago

comment:1 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: newclosed

(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.

Note: See TracTickets for help on using tickets.
Back to Top