I have seen people writing forms in models or in forms.py
? Is it the case I can actually write it anywhere say in blah.py
and just import it wherever necessary?
views:
46answers:
3That's quite vague. How do you know whether you can import it?
Pilgrim
2010-05-14 09:50:34
+4
A:
That's correct. It's just like any other python class, you can define your form classes in whichever file you prefer. However, it is often considered best practice for Django to put them in a file like APP/forms.py
.
huwshimi
2010-05-14 07:01:47
A:
You can, but it's better to put forms declarations in forms.py in order that other developers could feel familiar in your project.
matiit
2010-05-14 13:42:21