Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix isinstance issues and mro #127

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions crispy_tailwind/templatetags/tailwind_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,42 @@

@register.filter
def is_checkbox(field):
return isinstance(field.field.widget, forms.CheckboxInput)
return field.field.widget.__class__.__name__ == forms.CheckboxInput.__class__.__name__


@register.filter
def is_password(field):
return isinstance(field.field.widget, forms.PasswordInput)
return field.field.widget.__class__.__name__ == forms.PasswordInput.__class__.__name__


@register.filter
def is_radioselect(field):
return isinstance(field.field.widget, forms.RadioSelect)
return field.field.widget.__class__.__name__ == forms.RadioSelect.__class__.__name__


@register.filter
def is_select(field):
return isinstance(field.field.widget, forms.Select)
return field.field.widget.__class__.__name__ == forms.Select.__class__.__name__


@register.filter
def is_checkboxselectmultiple(field):
return isinstance(field.field.widget, forms.CheckboxSelectMultiple)
return field.field.widget.__class__.__name__ == forms.CheckboxSelectMultiple.__class__.__name__


@register.filter
def is_file(field):
return isinstance(field.field.widget, forms.FileInput)
return field.field.widget.__class__.__name__ == forms.FileInput.__class__.__name__


@register.filter
def is_clearable_file(field):
return isinstance(field.field.widget, forms.ClearableFileInput)
return field.field.widget.__class__.__name__ == forms.ClearableFileInput.__class__.__name__


@register.filter
def is_multivalue(field):
return isinstance(field.field.widget, forms.MultiWidget)
return field.field.widget.__class__.__name__ == forms.MultiWidget.__class__.__name__


@register.filter
Expand Down