> So my question is am I missing something or I was just expecting too
> much from the newforms?

I had similar problems initially, and after hundreds of forms built I
still get annoyed every time I have to build a newforms form.  On the
other hand, I can't really think of a better way to do it either (and
I've tried, oh how I tried).  Building a form from just a raw template
IS easier, but rendering is only part of newforms... its the
consistent way of doing validation in the view (or writing the
template) without knowing about the form details that are important as
far as I'm concerned.

The best advice I can give is to take a few minutes and read all of
the newforms code (especially the fields and widgets), and the
regression tests.  It's extremely well commented, and will probably
help a lot.  It did for me.

http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/forms/tests.py

>My last question is would it be absurd to have a form field called
>TemplateField to which we can give a template string that will be
>dynamically inserted and substituted in the template?

You could do that if you want to.  Override one of that
form.as_table,as_ul, etc methods to render from a template attribute.
I'm not sure why you would though since it's pretty easy to do
{{ form.fieldname }} in your view template if you don't like the
default newforms layouts.


--~--~---------~--~----~------------~-------~--~----~
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