The import is likely to be in your view:

# views.py
from forms import MyForm

myview(request):
    if request.method == 'POST':
        form = MyForm(request.POST)
    ...

That's assuming that views.py and forms.py are at the same level.

Cheers,

Julien

On Aug 23, 11:25 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote:
> Julien/Russell,
>
> Thanx for the info. Working around the name class would simply be resolved by 
> a 'myforms.py' (or something). One thing is still missing in my brain though. 
> If I put it in a myforms.py. How does Django (or my code if you will) knows 
> where to find this class. There should be an import statement somewhere then, 
> right?
>
> Forgive my Django noobness. And thanx a lot!!
>
> Regards,
>
> Gerard.
>
>
>
> Russell Keith-Magee wrote:
> > On Sat, Aug 23, 2008 at 8:59 PM, Julien Phalip <[EMAIL PROTECTED]> wrote:
> >> Hi,
>
> >> In Django there are no 'standard' as such. You'd talk more about
> >> 'conventions'.
> >> One common way is to put all your forms in forms.py. But that's just
> >> for cleanliness.
>
> > While this is a common convention, I would point out that it is not
> > without problems. If you have a local 'forms.py' module, you leave
> > yourself open to name clashes if you use 'from django import forms' in
> > your code.
>
> > However, the rest of your advice is correct - there is not set rule,
> > just conventions, and as long as Python can import it, the code will
> > work the same regardless of the location.
>
> > Yours,
> > Russ Magee %-)
>
> --
> urls = { 'fun':  'www.zonderbroodje.nl',  'tech':  'www.gp-net.nl'}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to