On 4/29/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
> 1) Is there room for a 'fields' argument on form_for_instance and
> form_for_model - a list of field names that you want included on the
> form (defaulting to None, meaning the full list), so that it is simple
> to create a form with a subset of a model's full field list?
>
> I realize that you can subclass the form class returned by the
> form_for_ methods and delete the fields you don't want, but 'form from
> field subset' seems like a fairly common use case that can be very
> easily accommodated.

+1. I'm planning on adding a similar argument to edit-inline. Writing
a one-off formfield_callback seems like an awful lot of work for such
a common task. I'm sure the same thing could be implemented as a
wrapper around the form_for_ functions using formfield_callback, but I
don't see any particular reason to do it that way as long as the
behavior of the 'fields' argument was documented as Malcolm said.

> 2) I realize that there are historical (i.e.,
> manipulator/pre-magic-removal related) reasons why reverse ForeignKey
> and M2M relations are not contained on forms, but is there any reason
> that newforms should continue the tradition?
>
> We probably don't want to include reverse fields on forms by default
> (if only for backwards compatibility), but providing an optional
> argument (say, reverse_fields=(...), containing a list of reverse
> descriptor names) on form_for_model and form_for_instance would allow
> users to easily include reverse relations on a form.

+1 for optionally doing this for ManyToManyField at least. Would the
reverse ForeignKey interface be similar to edit_inline? I think once I
finish the formset-model integration code, that should be pretty
simple to pull off.

Joseph

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