Ejemplo n.º 1
0
class TourSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Tour

    driver = marshmallow.Nested("DriverSchema")
    truck = marshmallow.Nested("TruckSchema")
    trailer = marshmallow.Nested("TrailerSchema")
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
class ProjectSchema(marshmallow.Schema):
    class Meta:
        model = Project
        fields = ('id', 'name', 'manager', 'description', 'tickets')

    tickets = marshmallow.Nested(TicketSchema, many=True)
Ejemplo n.º 4
0
class LoadSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Load

    tour = marshmallow.Nested("TourSchema")
    client = marshmallow.Nested("ClientSchema")
Ejemplo n.º 5
0
class ClientSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Client

    state = marshmallow.Nested("StateSchema")
Ejemplo n.º 6
0
class RealizationSchema(marshmallow.ModelSchema):
    class Meta:
        fields = ('id', 'realization', 'iteration', 'volumetrics')

    volumetrics = marshmallow.Nested(VolumetricSchema, many=True)
Ejemplo n.º 7
0
class LocationSchema(marshmallow.ModelSchema):
    class Meta:
        fields = ('id', 'region_name', 'zone_name', 'facies_name', 'license', 'realizations')

    realizations = marshmallow.Nested(RealizationSchema, many=True)
Ejemplo n.º 8
0
class StationSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Station
        load_instance = True

    address = marshmallow.Nested(AddressSchema)
Ejemplo n.º 9
0
class PortSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Port
        load_instance = True

    station = marshmallow.Nested(StationSchema)
Ejemplo n.º 10
0
class OutletSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Outlet
    
    value = ma.auto_field(as_string=True)
    available_times = ma.List(ma.Nested(AvailableTimeSchema))
Ejemplo n.º 11
0
class TaskWeekCollectionSchema(ma.Schema):
    weeks = ma.List(ma.Nested(TaskWeekSchema))
Ejemplo n.º 12
0
class TaskWeekSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = TaskWeek

    task = ma.Nested(TaskSchema)
Ejemplo n.º 13
0
class TaskSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Task
    outlet = ma.Nested(OutletSchema)
Ejemplo n.º 14
0
class EventSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Event
        load_instance = True

    port = marshmallow.Nested(PortSchema)