|
|
|
@ -50,7 +50,10 @@ class PokemonList:
|
|
|
|
|
with Session(self.engine) as session:
|
|
|
|
|
result = session.query(Pokemon).where(Pokemon.end_time > datetime.now() + self.timedelta)
|
|
|
|
|
session.commit()
|
|
|
|
|
return result.all().sort(key=lambda pokemon: location.distance(pokemon.location), reverse=reverse)
|
|
|
|
|
print(len(result.all()))
|
|
|
|
|
print(type(result.all()))
|
|
|
|
|
print(result.all().sort(key=lambda pokemon: location.distance(pokemon.location), reverse=reverse))
|
|
|
|
|
return sorted(result.all(), key=lambda pokemon: location.distance(pokemon.location), reverse=reverse)
|
|
|
|
|
|
|
|
|
|
def search_by_name(self, query: str):
|
|
|
|
|
with Session(self.engine) as session:
|
|
|
|
|