Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Dec. 8, 2010 16:36:13

c.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

When to use Form API


Do django developers use the Form API any time form elements need to
be displayed to users? Or do you just code the form yourself in the
templates and manually process them for smaller forms?

In general, is it always better to use the Form API for any form you
display, regardless how simple, because of the built-in functionality
provided by django, or is it overkill?


--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Dec. 8, 2010 17:14:42

Wayne S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

When to use Form API


It is important to distinguish between display and functionality with
forms. What I mean is, using the forms does not mean you have to render
(display) them the way Django has it set up by default. I always use the
Form API, and if I need custom validation on a field or the entire form, I
override the appropriate clean method. I pass the widget argument if I want
a different widget.

IMO, one of the best things about Django is the ease in which I can
customize its parts but still leverage its functionality.

On Wed, Dec 8, 2010 at 10:36 AM, christian.posta
<christian.po...@gmail.com>wrote:

> Do django developers use the Form API any time form elements need to
> be displayed to users? Or do you just code the form yourself in the
> templates and manually process them for smaller forms?
>
> In general, is it always better to use the Form API for any form you
> display, regardless how simple, because of the built-in functionality
> provided by django, or is it overkill?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Dec. 8, 2010 17:59:45

r.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

When to use Form API


This. Form processing is one of those tedious things 90% of which is
the same in every form: field definition, display, validation, and
error handling/presentation.

Django takes care of the repetitive parts, and if you need to
customize the validation or display, allows you to do so while still
abstracting away all the rest of the fiddly stuff.

If anything, manual form processing in Django would be overkill,
unless you have some special case that the form API simply can't
handle (e.g. nested formsets, although there are a few apps now that
enable that, IIRC)



On Dec 8, 12:14 pm, Wayne Smith <wayne.tuxro...@gmail.com> wrote:
> It is important to distinguish between display and functionality with
> forms.  What I mean is, using the forms does not mean you have to render
> (display) them the way Django has it set up by default.  I always use the
> Form API, and if I need custom validation on a field or the entire form, I
> override the appropriate clean method.  I pass the widget argument if I want
> a different widget.
>
> IMO, one of the best things about Django is the ease in which I can
> customize its parts but still leverage its functionality.
>
> On Wed, Dec 8, 2010 at 10:36 AM, christian.posta
> <christian.po...@gmail.com>wrote:
>
> > Do django developers use the Form API any time form elements need to
> > be displayed to users? Or do you just code the form yourself in the
> > templates and manually process them for smaller forms?
>
> > In general, is it always better to use the Form API for any form you
> > display, regardless how simple, because of the built-in functionality
> > provided by django, or is it overkill?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 17th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support