MCPcopy
hub / github.com/tortoise/tortoise-orm / distinct

Method distinct

tortoise/queryset.py:578–587  ·  view source on GitHub ↗

Make QuerySet distinct. Only makes sense in combination with a ``.values()`` or ``.values_list()`` as it precedes all the fetched fields with a distinct.

(self)

Source from the content-addressed store, hash-verified

576 return queryset
577
578 def distinct(self) -> QuerySet[MODEL]:
579 """
580 Make QuerySet distinct.
581
582 Only makes sense in combination with a ``.values()`` or ``.values_list()`` as it
583 precedes all the fetched fields with a distinct.
584 """
585 queryset = self._clone()
586 queryset._distinct = True
587 return queryset
588
589 def select_for_update(
590 self,

Callers 9

_get_function_fieldMethod · 0.80
test_filteringFunction · 0.80
test_distinctFunction · 0.80
test_relationsFunction · 0.80
runFunction · 0.80
runFunction · 0.80

Calls 1

_cloneMethod · 0.95

Tested by 6

test_filteringFunction · 0.64
test_distinctFunction · 0.64
test_relationsFunction · 0.64