MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / getTargetProfile

Function getTargetProfile

eos/db/saveddata/queries.py:423–440  ·  view source on GitHub ↗
(lookfor, eager=None)

Source from the content-addressed store, hash-verified

421
422@cachedQuery(TargetProfile, 1, "lookfor")
423def getTargetProfile(lookfor, eager=None):
424 if isinstance(lookfor, int):
425 if eager is None:
426 with sd_lock:
427 pattern = saveddata_session.query(TargetProfile).get(lookfor)
428 else:
429 eager = processEager(eager)
430 with sd_lock:
431 pattern = saveddata_session.query(TargetProfile).options(*eager).filter(
432 TargetProfile.ID == lookfor).first()
433 elif isinstance(lookfor, str):
434 eager = processEager(eager)
435 with sd_lock:
436 pattern = saveddata_session.query(TargetProfile).options(*eager).filter(
437 TargetProfile.rawName == lookfor).first()
438 else:
439 raise TypeError("Need integer or string as argument")
440 return pattern
441
442
443@cachedQuery(ImplantSet, 1, "lookfor")

Callers

nothing calls this directly

Calls 2

processEagerFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected