Opened 4 years ago

Closed 23 months ago

#17115 closed Bug (duplicate)

Problem loading fixtures sql files when models are in models/ directory and not in the models.py

Reported by: shomodj@… Owned by: nobody
Component: Core (Management commands) Version: 1.3
Severity: Normal Keywords: models fixtures
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If I put model files into models/ directory and add Meta: app_label, sql create works, but now fixtures don't work as django now looks in the app/models/sql path and not in the app/sql path as stated in the documentation.

bug is in the django/core/management/sql.py line 130

Now I'm not sure if this is a documentation bug or django bug...

Attachments (1)

patch.txt (829 bytes) - added by shomodj@… 4 years ago.
Patch

Download all attachments as: .zip

Change History (4)

comment:1 Changed 4 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

You shouldn't have to move your fixtures if you split your models.py into a subpackage, so I'd say it's a functionality bug not a documentation bug.

I haven't verified the bug personally, but can see how it would happen based on that line of code.

Changed 4 years ago by shomodj@…

Patch

comment:2 Changed 4 years ago by shomodj@…

Let me know if the patch is good and I will write a test for it, thx.

comment:3 Changed 23 months ago by timo

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #14300

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