Adde Aircraft class and associate students with aircrafts
This commit is contained in:
@@ -20,12 +20,12 @@ class MissionProfileResource(ModelResource):
|
||||
duration = fields.Field(attribute="duration", column_name="duration")
|
||||
|
||||
# Cleanup fields before entering
|
||||
def before_import_row(self, row: dict[str, str | Any], **kwargs) -> None:
|
||||
def before_import_row(self, row: dict[str, str | Any], **kwargs):
|
||||
row["mtype"] = SafeText(row["mtype"].upper().strip())
|
||||
row["mnum"] = SafeText(row["mnum"].upper().strip())
|
||||
h, m, _ = row["duration"].split(":")
|
||||
row["duration"] = timedelta(hours=float(h), minutes=float(m))
|
||||
return super().before_import_row(row, **kwargs)
|
||||
super().before_import_row(row, **kwargs)
|
||||
|
||||
class Meta:
|
||||
model = MissionProfile
|
||||
|
||||
Reference in New Issue
Block a user