Open mmarras opened 1 month ago
Possibly this has to solved on Django level tho. Still looking into it...
https://code.djangoproject.com/ticket/5851#comment:14
according to this MultiWidget should be able to handle individual attrs...
The related commit shows:
def __init__(self, attrs=None, date_format=None, time_format=None, date_attrs=None, time_attrs=None):
widgets = (
DateInput(
attrs=attrs if date_attrs is None else date_attrs,
format=date_format,
),
TimeInput(
attrs=attrs if time_attrs is None else time_attrs,
format=time_format,
),
)
super().__init__(widgets)
Feel free to adopt.
There is no way to define individual attributes to the NumberInput or Select tag because both are fed the same attribute dictionary.
I suggest to split that up, since both are different types which may require different attributes in the html tag.