class TourSchema(marshmallow.SQLAlchemyAutoSchema): class Meta: model = Tour driver = marshmallow.Nested("DriverSchema") truck = marshmallow.Nested("TruckSchema") trailer = marshmallow.Nested("TrailerSchema")
class CaseSchema(marshmallow.ModelSchema): class Meta: ordered = True fields = ('id', 'name', 'created_user', 'case_type', 'created_date', 'case_version', 'description', 'is_official', 'is_shared', 'official_from_date', 'official_to_date', 'field_name', 'locations') locations = marshmallow.Nested(LocationSchema, many=True)
class ProjectSchema(marshmallow.Schema): class Meta: model = Project fields = ('id', 'name', 'manager', 'description', 'tickets') tickets = marshmallow.Nested(TicketSchema, many=True)
class LoadSchema(marshmallow.SQLAlchemyAutoSchema): class Meta: model = Load tour = marshmallow.Nested("TourSchema") client = marshmallow.Nested("ClientSchema")
class ClientSchema(marshmallow.SQLAlchemyAutoSchema): class Meta: model = Client state = marshmallow.Nested("StateSchema")
class RealizationSchema(marshmallow.ModelSchema): class Meta: fields = ('id', 'realization', 'iteration', 'volumetrics') volumetrics = marshmallow.Nested(VolumetricSchema, many=True)
class LocationSchema(marshmallow.ModelSchema): class Meta: fields = ('id', 'region_name', 'zone_name', 'facies_name', 'license', 'realizations') realizations = marshmallow.Nested(RealizationSchema, many=True)
class StationSchema(marshmallow.SQLAlchemyAutoSchema): class Meta: model = Station load_instance = True address = marshmallow.Nested(AddressSchema)
class PortSchema(marshmallow.SQLAlchemyAutoSchema): class Meta: model = Port load_instance = True station = marshmallow.Nested(StationSchema)
class OutletSchema(ma.SQLAlchemyAutoSchema): class Meta: model = Outlet value = ma.auto_field(as_string=True) available_times = ma.List(ma.Nested(AvailableTimeSchema))
class TaskWeekCollectionSchema(ma.Schema): weeks = ma.List(ma.Nested(TaskWeekSchema))
class TaskWeekSchema(ma.SQLAlchemyAutoSchema): class Meta: model = TaskWeek task = ma.Nested(TaskSchema)
class TaskSchema(ma.SQLAlchemyAutoSchema): class Meta: model = Task outlet = ma.Nested(OutletSchema)
class EventSchema(marshmallow.SQLAlchemyAutoSchema): class Meta: model = Event load_instance = True port = marshmallow.Nested(PortSchema)