Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect import generated for a Django app that is a subpackage #4

Open
jklaiho opened this issue Jul 2, 2013 · 0 comments
Open
Milestone

Comments

@jklaiho
Copy link
Owner

jklaiho commented Jul 2, 2013

When a Django app package is a subpackage of a non-app package, dumpdata generates an incorrect import for that package.

For example:

parent
|___ first_app
|      |___ models.py
|___ second_app
|      |___ models.py
...

The generated import should be from parent.first_app.models import SomeModel, but instead it's just from first_app.models import SomeModel, which is incorrect. What's worse, this should actually be an ImportError, but the loaddata processing is eating it somehow and "No fixtures found." is printed, adding to the confusion.

The problem lies in the simplistic app name / model name combining logic to create the import rows, located in the dump_class_fixtures() function of utils/serialization.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant