(lookfor, eager=None)
| 168 | |
| 169 | @cachedQuery(Character, 1, "lookfor") |
| 170 | def getCharacter(lookfor, eager=None): |
| 171 | if isinstance(lookfor, int): |
| 172 | if eager is None: |
| 173 | with sd_lock: |
| 174 | character = saveddata_session.query(Character).get(lookfor) |
| 175 | else: |
| 176 | eager = processEager(eager) |
| 177 | with sd_lock: |
| 178 | character = saveddata_session.query(Character).options(*eager).filter(Character.ID == lookfor).first() |
| 179 | elif isinstance(lookfor, str): |
| 180 | eager = processEager(eager) |
| 181 | with sd_lock: |
| 182 | character = saveddata_session.query(Character).options(*eager).filter( |
| 183 | Character.savedName == lookfor).first() |
| 184 | else: |
| 185 | raise TypeError("Need integer or string as argument") |
| 186 | return character |
| 187 | |
| 188 | |
| 189 | def getCharacterList(eager=None): |
nothing calls this directly
no test coverage detected