|
List Info
Thread: Silly Newforms Best Practices Question
|
|
| Silly Newforms Best Practices Question |
  United States |
2007-05-25 19:58:50 |
Obviously, this doesn't *really* matter, but I'm looking for
best
practices:
Where would you recommend putting the code for a custom form
class?
In views.py? In models.py? In a separate forms.py?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Silly Newforms Best Practices
Question |

|
2007-05-25 20:40:50 |
On 5/26/07, ringemup <ringemup gmail.com> wrote:
>
> Obviously, this doesn't *really* matter, but I'm
looking for best
> practices:
>
> Where would you recommend putting the code for a custom
form class?
> In views.py? In models.py? In a separate forms.py?
Personally, I've been putting forms in forms.py. Ultimately,
it
doesn't really matter where you put them, but forms.py is a
reasonably
obvious location.
Yours,
Russ Magee %-)
--~--~---------~--~----~------------~-------~--~----~
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
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Silly Newforms Best Practices
Question |
  United States |
2007-05-25 21:53:40 |
As always, depends. Just think about how source control
(i.e. code
ownership), re-usability and IDE integration/navigation
would fit with
each approach. Contrary to Russ, I have my form classes near
to my
view functions, but I won't bet my C++ Builder 4 CD that its
the best
way
Probably not an issue, but if you import as:
from django import newforms as forms
you may want to watch out for namespace issues.
-rob
On May 25, 5:58 pm, ringemup <ringe... gmail.com> wrote:
> Obviously, this doesn't *really* matter, but I'm
looking for best
> practices:
>
> Where would you recommend putting the code for a custom
form class?
> In views.py? In models.py? In a separate forms.py?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Silly Newforms Best Practices
Question |
  United States |
2007-05-26 22:48:36 |
On May 26, 2:53 pm, oggie rob <oz.robhar... gmail.com> wrote:
> Probably not an issue, but if you import as:
> from django import newforms as forms
> you may want to watch out for namespace issues.
That's why, like Russ, I also use a forms.py file and do the
newforms
import like:
from django.newforms import *
Then in my views I'll just import the form classes I
create.
--~--~---------~--~----~------------~-------~--~----~
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
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Silly Newforms Best Practices
Question |
  United States |
2007-05-26 22:56:51 |
On 27-May-07, at 9:18 AM, SmileyChris wrote:
> That's why, like Russ, I also use a forms.py file and
do the newforms
> import like:
> from django.newforms import *
i import django.newforms as nforms - so i can use both new
and old
--
regards
kg
http://lawgon.livejourn
al.com
http://nrcfosshelpline
.in/web/
--~--~---------~--~----~------------~-------~--~----~
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
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Silly Newforms Best Practices
Question |
  United States |
2007-05-29 10:09:49 |
Thanks for the ideas, guys! Looks to me like forms.py will
do the
trick for now.
--~--~---------~--~----~------------~-------~--~----~
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
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
[1-6]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|