I'm not sure whether or not to accept a related proposal to add a 
"formfield_defaults" keyword to model fields [0]. e.g.

link = models.OneToOneField(
    ...
    formfield_defaults={
        'widget': forms.RadioSelect,
    }
)


It seems useful, but I'm not sure if it increases the coupling between 
model and forms in an undesirable way?

[0] https://code.djangoproject.com/ticket/26369

On Wednesday, March 9, 2016 at 1:43:16 PM UTC-5, Johannes Hoppe wrote:
>
> I got that, but you can't just make it your default widget, it will always 
> require more information. And I don't really like "defaults", again pep20.
>
> I currently don't have any need for action, therefore I won't do anything. 
> If you want to make a draft on how to refactor it, I'm happy to review it.
>
>> On Mar 9 2016, at 6:49 pm, James Pic <[email protected] <javascript:>> 
>> wrote: 
>>
>> I just meant that currently, if a user wants to make Select2 the
>> default widget for a model field, it is necessary to subclass the
>> modelfield class and override the model field's formfield() method
>> just to change the default widget it uses, sorry if it wasn't clear !
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-developers/zG-JvS_opi4/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/CALC3Kaet9-Fy7BF64Fgtjh3MBz9EA7DR67FUkzhdS2HGg4821g%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/02213ab6-58fc-4abd-8f82-e147ff059d72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to