Honza Král wrote:
On 1/6/07, Mikko Ohtamaa <[EMAIL PROTECTED]> wrote:


well, the problem I see here is that you move the responsibility to
programmer, if designer wishes to change the output, he would have to
go to python...

Producing HTML is Python is the root of the problem. Most of HTML
widget libraries out there use template pieces to produce form output -
one template per widget. Have you had any though to move this kind of
solution? I already once hacked oldforms a bit to provide me
TemplateWidget. Or do you feel this kind of solution would be "core
enough" for Django?

It could be easily done with one master widget template which would be
extended by per-class widget templates. The user could easily override
the master template for site specific customizations.

this is a very nice work, but again I feel like it is unnecessary and
sometimes promotes bad habits, for example validation should take
place IN the form - otherwise you defy its purpose
to do that you simply override the clean() method or you add
clean_FIELD() to validate individual fields...

Ah. I was not aware of clean_FIELD() possibility. I am not sure whether
is what documented yet so I have missed it. This sounds great!


also hacking into a form instance via form.data and form.is_bound
directly seems wrong - it is not part of the published interface and
can change...

Yes, that's a stop gap solution. I hope BaseForm would provide more
hooks for custom implementations.

looks like a lot less work then subclassing your FormHandler and
working with that... its so little typing that its almost not worth
writing a wrapper around that - the wrapper (in order to be useful)
would have to have so many options that it would be much more
complicated that this straightforward code, which gives you way more
flexibility...

Ok. I'll see what direction newforms begins to evolve. I'll try to
develop FormHandler by then through real world use cases. Also, I can
maintain it as a separate downloadble product.

Great work guys!

Cheers,
Mikko


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