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

Associations often have circular import issues #4

Closed
beanpuppy opened this issue Jun 19, 2021 · 1 comment
Closed

Associations often have circular import issues #4

beanpuppy opened this issue Jun 19, 2021 · 1 comment

Comments

@beanpuppy
Copy link
Contributor

Sometimes circular imports are a sign of poor structuring, but other times they're unavoidable because Python's module system can't match the complexity of all DB relationships.

The best solution seems to be something similar to Django ORM's "lazy relationships", where you can pass the model as a string instead of the actual model object itself.

https://docs.djangoproject.com/en/2.0/ref/models/fields/#django.db.models.ForeignKey

@beanpuppy
Copy link
Contributor Author

Added in f738aec.

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