(lookfor, eager=None)
| 205 | |
| 206 | @cachedQuery(Fit, 1, "lookfor") |
| 207 | def getFit(lookfor, eager=None): |
| 208 | if isinstance(lookfor, int): |
| 209 | if eager is None: |
| 210 | with sd_lock: |
| 211 | fit = saveddata_session.query(Fit).get(lookfor) |
| 212 | else: |
| 213 | eager = processEager(eager) |
| 214 | with sd_lock: |
| 215 | fit = saveddata_session.query(Fit).options(*eager).filter(Fit.ID == lookfor).first() |
| 216 | else: |
| 217 | raise TypeError("Need integer as argument") |
| 218 | |
| 219 | if fit and fit.isInvalid: |
| 220 | with sd_lock: |
| 221 | removeInvalid([fit]) |
| 222 | return None |
| 223 | |
| 224 | return fit |
| 225 | |
| 226 | |
| 227 | def getFitsWithShip(shipID, ownerID=None, where=None, eager=None): |
no test coverage detected