Sprava eventu a organizaci, bugfixing a drobny refaktoring

This commit is contained in:
Michal Kváček
2023-09-20 13:26:34 +02:00
parent 1760dba99d
commit 037c7daef6
17 changed files with 557 additions and 41 deletions
+6 -1
View File
@@ -3,7 +3,7 @@ from typing import List, Optional
from sqlalchemy import select
from strawberry.dataloader import DataLoader
from database import async_session
from database.models import Flight, Copilot, PointOfInterest
from database.models import Flight, Copilot, PointOfInterest, Event
class FlightsLoader:
@@ -43,3 +43,8 @@ flight_by_poi_dataloader = DataLoader(
load_fn=FlightsLoader(PointOfInterest.id, extra_join=[Flight.track, PointOfInterest]).load,
cache=False
)
flights_by_event_dataloader = DataLoader(
load_fn=FlightsLoader(Event.id, extra_join=[Flight.event]).load,
cache=False
)