Closed radokristof closed 2 years ago
Right now, I'm using MultipleLookupFieldsMixin for enabling to lookup an object by multiple unique fields.
lookup_fields = ["qr_id", "hashid", "uid"] lookup_value_regex = '(?P<qr_id>\\d{4}-.+)|(?P<uid>\\w{2}_.+_.+)|(?P<hashid>[a-zA-Z0-9]+)'
However with nested routes, I can only specify one parents_query_lookups. Is it somehow possible to use this mixin in the nested viewset as well, so it would work with all lookup field?
I was able to achieve this by overriding the get_parents_query_dict method
get_parents_query_dict
Right now, I'm using MultipleLookupFieldsMixin for enabling to lookup an object by multiple unique fields.
However with nested routes, I can only specify one parents_query_lookups. Is it somehow possible to use this mixin in the nested viewset as well, so it would work with all lookup field?