fixed naming in query

This commit is contained in:
Daniel Schick 2024-01-15 17:10:21 +01:00
parent 801800df92
commit 708fa5ce37
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ def GetShipcalls(options):
commands = pydapper.using(pooledConnection)
query = ("SELECT id, ship_id, type, eta, voyage, etd, arrival_berth_id, departure_berth_id, tug_required, pilot_required, "
"flags, pier_side, bunkering, replenishing_terminal, replenishing_lock, draft, tidal_window_from, tidal_window_to, rain_sensitive_cargo, recommended_tugs, "
"anchored, moored_lock, canceled, evaluation, evaluation_message, evaluation_time, evaluation_message_sent, created, modified FROM shipcall WHERE ((type = 1 OR type = 3) AND eta >= DATE(NOW() - INTERVAL %d DAY)"
"anchored, moored_lock, canceled, evaluation, evaluation_message, evaluation_time, evaluation_notifications_sent, created, modified FROM shipcall WHERE ((type = 1 OR type = 3) AND eta >= DATE(NOW() - INTERVAL %d DAY)"
"OR (type = 2 AND etd >= DATE(NOW() - INTERVAL %d DAY))) "
"ORDER BY eta") % (options["past_days"], options["past_days"])

View File

@ -127,7 +127,7 @@ class ShipcallSchema(Schema):
evaluation = fields.Int(Required = False, allow_none=True)
evaluation_message = fields.Str(allow_none=True, metadata={'Required':False}) # Solving: RemovedInMarshmallow4Warning: Passing field metadata as keyword arguments is deprecated. Use the explicit `metadata=...` argument instead. Additional metadata: {'Required': False}
evaluation_time = fields.DateTime(Required = False, allow_none=True)
evaluation_message_sent = fields.Bool(Required = False, allow_none=True)
evaluation_notifications_sent = fields.Bool(Required = False, allow_none=True)
participants = fields.List(fields.Nested(ParticipantAssignmentSchema))
created = fields.DateTime(Required = False, allow_none=True)
modified = fields.DateTime(Required = False, allow_none=True)
@ -171,7 +171,7 @@ class Shipcall:
evaluation: int
evaluation_message: str
evaluation_time: datetime
evaluation_message_sent: bool
evaluation_notifications_sent: bool
created: datetime
modified: datetime
participants: List[Participant_Assignment] = field(default_factory=list)