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

EntityFilter issue with M2M fields #513

Open
hsmett opened this issue Jan 13, 2023 · 1 comment
Open

EntityFilter issue with M2M fields #513

hsmett opened this issue Jan 13, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@hsmett
Copy link
Member

hsmett commented Jan 13, 2023

When creating an EntityFilter for with two conditions targeting the same M2M field, the resulting listview items are incorrect.
For exemple, given

    Class Stuff(CremeEntity):
        things = models.ManyToManyField(Thing ...)

The stuff resulting from a filter with conditions (things = a_thing) & (things != another_thing) would be wrong.

@hsmett hsmett added the bug Something isn't working label Jan 13, 2023
@genglert genglert self-assigned this Jan 13, 2023
@genglert
Copy link
Contributor

genglert commented Jan 13, 2023

There's a workaround: move one of the conditions in a sub-filter.
Edit: a condition '!=' + a sub-filter with the condition '=' (order is important).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants