Skip to content

Cannot override css_class_name on class instantiation #220

@adrien-delhorme

Description

@adrien-delhorme

Hi,

css_class_name = "django-select2"

The css_class_name attribute on all widgets classes inheriting Select2Mixin cannot be overridden when instantiating the class. Because there is no

def __init__(self, *args, **kwargs):
    ...
    this.css_class_name = kwargs.get("css_class_name")
    ...

in 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions