In all cases in Django, if your code imports the class, you can put it
wherever you like - so long as Python can find it.  It's only things that
are "discovered" by Django [admin, models, etc] that must be in a specific
module.

By convention, forms are put into forms.py ... but that's so _humans_ will
know where to look.

That said, it certainly would be a good thing for the tutorial to explain
this, and for the forms docs to recommend using "mapp/forms.py".

Do you feel up to writing a patch and making a PR?

--
Curtis


On 20 February 2015 at 09:38, Diana Probst <dianacpro...@googlemail.com>
wrote:

> I've been struggling to add forms to an app I am building, because the
> context of where to put form classes is missing in the docs.  I don't want
> to take a guess, even if it's right, when I could be following best
> practice.  In the 1.7 tutorial, the namespacing and file naming is laid out
> pretty simply, but in the Working with Forms page,
> https://docs.djangoproject.com/en/1.7/topics/forms/ which is the start of
> the overview, there is nothing setting out that I should, say, be using
> /myapp/forms.py .  I think that would be a valuable thing to add to the
> docs.  I've searched for where else it might be, and I can't find it, so
> even if it does exist elsewhere, the difficulty of finding this information
> is high.
>
> The tutorials have the name of file at the top of each example, which is
> my favourite solution, but even a briefing at the top of the forms overview
> would be an improvement on what is currently a low information zone.
> Currently, I don't have access to info on how to namespace my forms, and
> where to create what I'm creating.  It's a small change that would make the
> docs clearer and easier to use.
>
> DP
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/f5a8e89f-d9d8-46a3-95b7-0b075c15fec4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/f5a8e89f-d9d8-46a3-95b7-0b075c15fec4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAG_XiSDXPmp-Q_5V7aOY%2BajyaWVzFZe51KaffpDOFsuOEwvchw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to