Adrian Holovaty wrote:
> On 1/10/07, Mikko Ohtamaa <[EMAIL PROTECTED]> wrote:
> > I have toyed around with newforms a bit.
> >
> > We should subclass Widget to TemplateWidget and then rebuild all widget
> > class hierarchy usingTemplateWidget based widgets. I'd rather throw
> > away the current widgets outputting HTML in Python code once for all.
> > Otherwise you'd need to override Field default widgets always.
> >
> > I don't see any drawback for template based widgets expect that running
> > template engine consumes more CPU cycles. But if that's a problem for
> > someone, I am willing to buy him/her a new server :)
>
> I see a huge drawback in offloading widget rendering to the template
> system -- it couples the forms library to the template system. Ideally
> the newforms library, when solidified, would be distributed as a
> standalone package that doesn't require the rest of Django.
>
> What if, instead of using the template system, we just provided a
> better hook for specifying display? But before you answer that
> question, please tell me this: How does the current Widget system
> prevent you from doing what you want to do? I'm still having trouble
> understanding your problem. The more concrete your example, the
> better.
>
> Adrian
>
> --
> Adrian Holovaty
> holovaty.com | djangoproject.com


Newforms is new and in-development - groking newforms' basic premise is
a lot easier than sniffing out the right design patterns to make it
work in the real world. Maybe Mikko is looking to customise Widgets
with templates in order to accomplish things that you had envisioned
doing by, say, overriding as_ul() to use Django templates? I think a
lot of these kinds of things will become a lot clearer as the docs get
filled out.

--Paul


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to