Cannot override css_class_name
on class instantiation
#221
Unanswered
adrien-delhorme
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @adrien-delhorme, Yes, that was intentional. The thought behind it was, to have a separate Python class for a different HTML element class. Is there any particular reason, why doesn't inheritance work well in your use case? I am curious. There are so many ways to do things. Cheers! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
django-select2/django_select2/forms.py
Line 83 in ed1af30
The
css_class_name
attribute on all widgets classes inheritingSelect2Mixin
cannot be overridden when instantiating the class. Because there is noin any
__init__()
.The only way to override
css_class_name
is to create a new class inheriting the desired widget: not very handy.Is this intentional? Can we improve this?
Beta Was this translation helpful? Give feedback.
All reactions