I would really like to make a form instance a model attribute so that i have access to the form from the template through an object that I have handy.
When I try to import import any form into models.py, I get an ImportError on each of the import statements in the forms.py file which reference a model in models.py. I’m assuming this is due to circular imports.
I can’t seem to find any information on importing forms into models. Is this possible? If so, how?
What you’re doing doesn’t sound right, but if you want to do it you can embed the form import in the models’ instance method like so: