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

Choices frontend #252

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

erfaan
Copy link

@erfaan erfaan commented Dec 1, 2016

Fixes #175

@bufke
Copy link
Member

bufke commented Dec 1, 2016

Thanks for contributing! Is this a work in progress?

ng-if="!field.choices" needs to be ng-if="!field.field_choices"

Once that is fixed though I get:

image

Another consideration to make is that some filter types don't make sense with a single select box. For example I may want to filter with the In type where I'd expect to enter multiple values.

@erfaan
Copy link
Author

erfaan commented Dec 1, 2016

The simplest way to enable choices in FilterFieldSerializer seems to be to add choices field which is already available in model FilterField. It can work for both new filters and saved filters if we change field_choices to choices as well.

Regarding, rendered output, I was using Choices from django-model-utils to create choices and it worked for that. May be we need to modify the get_choices method and return the neutralized choices.

Yes, I agree, we should render textbox for some filter types (in).

@erfaan
Copy link
Author

erfaan commented Dec 2, 2016

I have made the name of choices key consistent across different APIs and added support for choices of type Choice from django-model-utils

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

Successfully merging this pull request may close these issues.

2 participants