Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Where are forms usually defined?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nick Arnett  
View profile  
 More options Nov 4, 6:20 am
From: Nick Arnett <nick.arn...@gmail.com>
Date: Tue, 3 Nov 2009 11:20:41 -0800
Local: Wed, Nov 4 2009 6:20 am
Subject: Where are forms usually defined?

I find myself frequently frustrated by examples and tutorials that include
code snippets that don't identify where they live.  In particular, I haven't
quite figured out where forms usually are defined and then where they need
to be imported.

I see that forms sometimes are in a file called forms.py... but somewhere
I'd expect to then see an import statement along the lines of "from
mysite.forms import *".  If I use forms.py for my forms, where does that
file need to be imported?

Thanks,

Nick


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
f4nt  
View profile  
 More options Nov 4, 6:26 am
From: f4nt <xxf4n...@gmail.com>
Date: Tue, 3 Nov 2009 11:26:06 -0800 (PST)
Local: Wed, Nov 4 2009 6:26 am
Subject: Re: Where are forms usually defined?
forms.py is pretty standard. You'd end up importing them in your
views.py.

On Nov 3, 1:20 pm, Nick Arnett <nick.arn...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Arnett  
View profile  
 More options Nov 4, 6:28 am
From: Nick Arnett <nick.arn...@gmail.com>
Date: Tue, 3 Nov 2009 11:28:00 -0800
Subject: Re: Where are forms usually defined?

On Tue, Nov 3, 2009 at 11:26 AM, f4nt <xxf4n...@gmail.com> wrote:

> forms.py is pretty standard. You'd end up importing them in your
> views.py.

Thanks... that's what I was guessing.  But it appears to me that I sometimes
see ModelForms in models.py... wondering if that's typical.

Nick


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
f4nt  
View profile  
 More options Nov 4, 6:49 am
From: f4nt <xxf4n...@gmail.com>
Date: Tue, 3 Nov 2009 11:49:00 -0800 (PST)
Subject: Re: Where are forms usually defined?
I've seen that before as well, and I don't particularly like it. Some
people also customize the admin in the models.py file, which is also
annoying :).

On Nov 3, 1:28 pm, Nick Arnett <nick.arn...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hcarvalhoalves  
View profile  
 More options Nov 5, 7:39 am
From: hcarvalhoalves <hcarvalhoal...@gmail.com>
Date: Wed, 4 Nov 2009 12:39:14 -0800 (PST)
Local: Thurs, Nov 5 2009 7:39 am
Subject: Re: Where are forms usually defined?
The common convention seen on Django code and 3rd party apps is to
have a forms.py inside the app dir.

But It doesn't matter because Django doesn't enforce a particular file
name for this, you're free to organize your code tree as you like.
Keep in mind that Django is just Python, so if you're new to Python
you may want to understand how Python modules and imports work. Then
you will be comfortable on designing your code structure.

On Nov 3, 5:20 pm, Nick Arnett <nick.arn...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google