MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / resolveModelIterableIter

Function resolveModelIterableIter

src/resolution/frameworks/python.ts:150–157  ·  view source on GitHub ↗

* Find ModelIterable.__iter__ — the default iterable QuerySet invokes via * `self._iterable_class(self)`. Its __iter__ statically calls the SQL compiler, * so linking the dynamic dispatch here closes the QuerySet→SQL call chain. * (Over-approximates to the default iterable; .values()/.values_list

(context: ResolutionContext)

Source from the content-addressed store, hash-verified

148 * other BaseIterable subclasses, but ModelIterable is the canonical path.)
149 */
150function resolveModelIterableIter(context: ResolutionContext): string | null {
151 const cls = context.getNodesByName('ModelIterable').find((n) => n.kind === 'class');
152 if (!cls) return null;
153 const iter = context.getNodesByName('__iter__').find(
154 (n) => n.filePath === cls.filePath && n.startLine >= cls.startLine && n.startLine <= cls.endLine
155 );
156 return iter ? iter.id : null;
157}
158
159/**
160 * Parse a Django URL handler expression and return the symbol/module to link.

Callers 1

resolveFunction · 0.85

Calls 1

getNodesByNameMethod · 0.65

Tested by

no test coverage detected