コード例 #1
0
class TourSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Tour

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

    tickets = marshmallow.Nested(TicketSchema, many=True)
コード例 #4
0
class LoadSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Load

    tour = marshmallow.Nested("TourSchema")
    client = marshmallow.Nested("ClientSchema")
コード例 #5
0
class ClientSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Client

    state = marshmallow.Nested("StateSchema")
コード例 #6
0
class RealizationSchema(marshmallow.ModelSchema):
    class Meta:
        fields = ('id', 'realization', 'iteration', 'volumetrics')

    volumetrics = marshmallow.Nested(VolumetricSchema, many=True)
コード例 #7
0
class LocationSchema(marshmallow.ModelSchema):
    class Meta:
        fields = ('id', 'region_name', 'zone_name', 'facies_name', 'license', 'realizations')

    realizations = marshmallow.Nested(RealizationSchema, many=True)
コード例 #8
0
class StationSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Station
        load_instance = True

    address = marshmallow.Nested(AddressSchema)
コード例 #9
0
class PortSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Port
        load_instance = True

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

    task = ma.Nested(TaskSchema)
コード例 #13
0
class TaskSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Task
    outlet = ma.Nested(OutletSchema)
コード例 #14
0
class EventSchema(marshmallow.SQLAlchemyAutoSchema):
    class Meta:
        model = Event
        load_instance = True

    port = marshmallow.Nested(PortSchema)