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

Function getFitsWithShip

eos/db/saveddata/queries.py:227–246  ·  view source on GitHub ↗

Get all the fits using a certain ship. If no user is passed, do this for all users.

(shipID, ownerID=None, where=None, eager=None)

Source from the content-addressed store, hash-verified

225
226
227def getFitsWithShip(shipID, ownerID=None, where=None, eager=None):
228 """
229 Get all the fits using a certain ship.
230 If no user is passed, do this for all users.
231 """
232 if isinstance(shipID, int):
233 if ownerID is not None and not isinstance(ownerID, int):
234 raise TypeError("OwnerID must be integer")
235 filter = Fit.shipID == shipID
236 if ownerID is not None:
237 filter = and_(filter, Fit.ownerID == ownerID)
238
239 filter = processWhere(filter, where)
240 eager = processEager(eager)
241 with sd_lock:
242 fits = removeInvalid(saveddata_session.query(Fit).options(*eager).filter(filter).all())
243 else:
244 raise TypeError("ShipID must be integer")
245
246 return fits
247
248
249def getRecentFits(ownerID=None, where=None, eager=None):

Callers

nothing calls this directly

Calls 3

processWhereFunction · 0.90
processEagerFunction · 0.90
removeInvalidFunction · 0.85

Tested by

no test coverage detected