Skip to main content

lookup_spawns_duplicates

Return True if the given lookup path spawns duplicates.

def lookup_spawns_duplicates(
opts: Options,
lookup_path: string
) - > boolean

Return True if the given lookup path spawns duplicates.

Parameters

NameTypeDescription
optsOptionsThe metadata options of the Django model where the lookup starts
lookup_pathstringA string representing the field lookup path, with components separated by the LOOKUP_SEP (usually '__')

Returns

TypeDescription
booleanTrue if any part of the lookup path involves a many-to-many relationship that could result in duplicate rows, otherwise False