-
Notifications
You must be signed in to change notification settings - Fork 772
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
Add empty value choice for ChoiceFilter
#519
Add empty value choice for ChoiceFilter
#519
Conversation
OK. Good. This handles the
...or such. Make sense? |
a99b431
to
d6ca39a
Compare
@carltongibson - I've updated the PR. I'll add docs/test if this all looks good. |
e0bf76f
to
3f2d15d
Compare
Hi @carltongibson - the PR has been redone w/ docs and tests |
fe063b0
to
0687d61
Compare
Conflict in |
0687d61
to
38473c8
Compare
Rebased. |
https://travis-ci.org/carltongibson/django-filter/jobs/172588858#L593-L595
|
Just noticed that :( In the middle of another rebase. |
Already - tests should be good now. |
Adds empty and null value handling for
ChoiceFilter
, which should fix #45 and resolve #261.FILTERS_EMPTY_CHOICE_LABEL
,FILTERS_NULL_CHOICE_LABEL
, andFILTERS_NULL_CHOICE_VALUE
settings, which allow you to globally set the empty/null choice labels and the null choice value.'null'
, which should be a JS-friendly magic value.ChoiceFilter
, which now takes correspondingempty_label
,null_label
, andnull_value
arguments. This is based onModelChoiceField.empty_label
.empty_label
andnull_label
may be set toNone
to disable those choices.empty_label
defaults to---------
, which maintains consistency w/ Django. This can be overridden globally or per filter.null_label
defaults toNone
, which means users must opt into using it.TODO:
empty_label
valueempty_label
when Nonetest w/ other widgets (There isn't anything to test here?ChecboxSelectMultiple
)OrderingFilter
,AllValuesFilter
)