MCPcopy
hub / github.com/django/django / add_distinct_fields

Method add_distinct_fields

django/db/models/sql/query.py:2260–2265  ·  view source on GitHub ↗

Add and resolve the given fields to the query's "distinct on" clause.

(self, *field_names)

Source from the content-addressed store, hash-verified

2258 self.select = tuple(cols)
2259
2260 def add_distinct_fields(self, *field_names):
2261 """
2262 Add and resolve the given fields to the query's "distinct on" clause.
2263 """
2264 self.distinct_fields = field_names
2265 self.distinct = True
2266
2267 def add_fields(self, field_names, allow_m2m=True):
2268 """

Callers 1

distinctMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected