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

referenced_list or reference_many fields as filters #727

Closed
josephwmorse opened this issue Oct 9, 2015 · 2 comments
Closed

referenced_list or reference_many fields as filters #727

josephwmorse opened this issue Oct 9, 2015 · 2 comments
Labels

Comments

@josephwmorse
Copy link

Is there a way to use a referenced_list or reference_many field as a filter field? Neither seems to work for me - referenced_list generates an explicit error, and reference_many just doesn't work. This is the relevant code (using the 0.8.0 release):

projects.listView()
.filters([
    nga.field('id','number'),
    nga.field('name'),
    nga.field('state', 'reference_many')
        .targetEntity(admin.getEntity('states'))
        .targetField(nga.field('name'))
        .label('State')
])

If this is not supported, is there a workaround to implement category searches (i.e. state=California OR state=Texas)?

@Gargam
Copy link

Gargam commented Oct 14, 2015

Same here.

The doc mentions that it should work "Filter fields can be of any type, including reference. This allows to define custom filters with ease."

I guess referenced_list and reference_many has been added after.

@fzaninotto
Copy link
Member

referenced_list cannot be used as a filter - I don't see how it would work. reference_many should work, it's a bug indeed.

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

No branches or pull requests

3 participants