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)
| 225 | |
| 226 | |
| 227 | def 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 | |
| 249 | def getRecentFits(ownerID=None, where=None, eager=None): |
nothing calls this directly
no test coverage detected