Skip to content

ChainedManyToManyField repeated options #159

@MiltonLn

Description

@MiltonLn

Hello, i have the following model:
image

So, when i try to filter on the form and select two options for the field 'temas' that have both shared options on the field 'evaluaciones' the options appears duplicated (And it's fine because Relational DB design).

image

on a normal case the solution here must be use a distinct on the queryset, but i can't see on the code neither the documentation an option for distinct on ChainedManyToMany, for debugging purposes i had tested this on the views file:

image

Notice the line 65 that has a .distinct() in the end, with this solution the select works fine (This is not a final solution, just for debugging purposes) so i need to know if this is a real issue, if so, how can be added the distinct solution to the code? i'm new to the repo so i need feedback, if this is already solved please notice me how to use it.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions