Just to clarify - you're talking about form fields rather than model 
fields, right? I can see the argument for form fields but not for model 
fields.

Is there a better API we can think of for customising widgets from the 
field constructor that could then be passed through? As a rough example:

my_step_field = forms.FloatField(widget_attributes={"step": 0.5})

Rather than encode each kind of attribute in the form field constructor it 
could take a dictionary that is passed along to customise the widget. Often 
I've found it 
annoying to track down the exact widget required, find the import, and then 
customise the widget. The specific arguments to fill out the attributes are 
less onerous.

Thoughts?

On Wednesday, 17 March 2021 at 18:54:29 UTC+11 jacob...@gmail.com wrote:

> On Wednesday, March 17, 2021 at 12:49:48 AM UTC+1 
> in...@markusholtermann.eu wrote:
>
>> That sounds like a sensible feature. Do you want to open a ticket and 
>> maybe implement it?
>>
>
> Hi Markus,
> ticket #32559 <https://code.djangoproject.com/ticket/32559> has been 
> issued to propose this feature.
> If accepted I will assign myself to implement it.
>
> – Jacob
>

-- 
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 django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/67a32579-a119-4d54-b765-0e2dad850771n%40googlegroups.com.
  • Pro... Jacob Rief
    • ... Markus Holtermann
      • ... Jacob Rief
        • ... Josh Smeaton
          • ... Carlton Gibson
            • ... Jacob Rief
              • ... Carlton Gibson
                • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
                • ... Jacob Rief
                • ... Kapil Bansal
                • ... Jacob Rief
                • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
                • ... Jacob Rief
                • ... James Bennett

Reply via email to