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

Allow CharField's with choice to be overriden using filter_overrides #25

Closed
yeago opened this issue Nov 24, 2009 · 4 comments
Closed

Allow CharField's with choice to be overriden using filter_overrides #25

yeago opened this issue Nov 24, 2009 · 4 comments

Comments

@yeago
Copy link

yeago commented Nov 24, 2009

This line seems to prevent anything with 'choices' to be overridable with filter_overrides.

http://github.com/alex/django-filter/blob/master/django_filters/filterset.py#L277

@yeago
Copy link
Author

yeago commented Dec 8, 2009

I changed line to:

 if not f.__class__ in cls.filter_overrides and f.choices:

@tshddx
Copy link

tshddx commented Sep 14, 2010

Might this be related to this issue: http://github.com/alex/django-filter/issues#issue/30 ?

My CharField with choices works fine (renders as a select element) unless I explicitly specify the field in my FilterSet. Thus I am unable to override the widget for a CharField with choices to use, for example, radio buttons instead of a select element.

@nkryptic
Copy link
Contributor

The filter_overrides is probably too generic to be used for handling this case. I think a better mens of addressing it would be to add a widgets attribute to FilterSet.Meta class and deal with it in the same way a ModelForm does.

@carltongibson
Copy link
Owner

Somewhere in the sands of time this one got lost. filter_overrides only makes an appearance in the filter_for_field class method and not in any way that makes sense of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants