Decision needed on formfield_callback

64 views
Skip to first unread message

poswald

unread,
Feb 27, 2013, 9:01:05 AM2/27/13
to django-d...@googlegroups.com
I'm wondering if we can open a quick discussion on the `formfield_callback` method of django ModelForms..

The basic issue boils down to the fact that we have an undocumented (and thus unsupported) method on ModelForm that would benefit greatly from a small change in behavior and an official blessing in the form of some documentation:


This would be very helpful to developers who want to ensure that all of the model forms extending their form get a certain overridden field, or for a project like django-floppyforms. In the ticket Russ mentions not being 100% happy with the patches. Is there a better way to define the standard field type to use for a given type? I'm wondering if we can discuss what we would like to see changed in that code to make it acceptable for a merge...

Thanks!
-Paul

Shai Berger

unread,
Feb 27, 2013, 4:06:37 PM2/27/13
to django-d...@googlegroups.com
On Wednesday 27 February 2013, poswald wrote:
> I'm wondering if we can open a quick discussion on the `formfield_callback`
> method of django ModelForms..
>
> The basic issue boils down to the fact that we have an undocumented (and
> thus unsupported) method on ModelForm that would benefit greatly from a
> small change in behavior and an official blessing in the form of some
> documentation:
>
> https://code.djangoproject.com/ticket/12915
>
> This would be very helpful to developers who want to ensure that all of the
> model forms extending their form get a certain overridden field, or for a
> project like django-floppyforms. In the ticket Russ mentions not being 100%
> happy with the patches. Is there a better way to define the standard field
> type to use for a given type?

I took a glance, and it seems like the formfield_callback belongs in the opts
object (and the Meta inner class), not the form class itself.

My 2 cents,

Shai.
Reply all
Reply to author
Forward
0 new messages