On Nov 7, 2007 10:26 PM, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
> ModelForm would be a declarative class that requires, at minimum, a
> model attribute. Other attributes would include:
>
> - formfield_callback (a function that takes a db field and **kwargs
> and returns a form field or None)
> - fields (a list of field names to include in the form)
> - exclude (a list of field names to exclude from the form)

I've been +1 on something like this for a long time, as you know :)

> The biggest problem I see is that this would be entirely backwards
> incompatible with the way form_for_model and form_for_instance work
> now. (especially the latter) It *may* be possible to change form_for_X
> into some sort of hackish wrappers, but it wouldn't be pretty.

I wouldn't lose any sleep if form_for_* died horrible flaming deaths;
in fact, I'd show up to toast marshmallows. They're not really
powerful enough to do what people want them to do, and so folks end up
spending inordinate amounts of time trying to shoehorn extra
functionality or customizations into them when (at the moment) the
path of least resistance is to just write a form class.

I've also felt for a while that the form_for_* helpers don't really
"fit" into newforms, because the big win in newforms from the
perspective of form authoring is the declarative class style; moving
to that style for generated forms would make it feel much more natural
to me.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

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