Exemplo n.º 1
0
class SubscriptionWatchSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = models.Watched
        exclude = ['ModifiedDate', 'ModifiedBy', 'CreatedDate', 'CreatedBy']

    episode = ma.Nested(EpisodesSchema)
    show = ma.Nested(ShowSchema)
Exemplo n.º 2
0
class SubscriptionSchema(ma.SQLAlchemyAutoSchema):
    watched = ma.Boolean(dump_only=True)

    class Meta:
        model = models.Subscription
        exclude = ['ModifiedDate', 'ModifiedBy', 'CreatedDate', 'CreatedBy']

    show = ma.Nested(ShowSchema)
Exemplo n.º 3
0
class SeasonWatchSchema(ma.SQLAlchemyAutoSchema):
    watched = ma.Boolean(dump_only=True)

    class Meta:
        model = models.SeasonWatched
        exclude = ['ModifiedDate', 'ModifiedBy', 'CreatedDate', 'CreatedBy']

    season = ma.Nested(SeasonSchema)
Exemplo n.º 4
0
class BuildingSchema(ma.Schema):
    """
    JSON schema for a building
    """
    class Meta:
        # JSON fields - type will be inferred
        # TODO: not exposing 'app_id', however this is in the database
        fields = ('b_id', 'name', 'address', 'address2', 'zipcode',
                  'image_url', 'website_url', 'latitude', 'longitude',
                  'shape_coordinates', 'phone_num', 'tags', 'categories')

    # 'address2' field maps to the DB model attribute 'city', which must explicitly defined w/ attribute mapping
    address2 = ma.String(attribute='city')

    # include lists of only the tag and category names
    tags = ma.Nested(TagSchema, only='tag_name', many=True)
    categories = ma.Nested(CategorySchema, only='cat_name', many=True)
Exemplo n.º 5
0
class SubscribedChannelSchema(CamelCaseSchema):
    watched = ma.Integer(dump_only=True)
    unwatched = ma.Integer(dump_only=True)

    class Meta:
        model = models.SubscribedChannel
        exclude = ['ModifiedDate', 'ModifiedBy', 'CreatedDate', 'CreatedBy']

    channel = ma.Nested(ChannelSchema)
Exemplo n.º 6
0
class SubscribedVideoSchema(CamelCaseSchema):
    class Meta:
        model = models.SubscribedVideo
        exclude = ['ModifiedDate', 'ModifiedBy', 'CreatedDate', 'CreatedBy']

    video = ma.Nested(VideoSchema)
Exemplo n.º 7
0
class UserBookSchema(CamelCaseSchema):
    class Meta:
        model = models.UserBook
        exclude = ['ModifiedDate', 'ModifiedBy', 'CreatedDate', 'CreatedBy']

    book = ma.Nested(BookSchema)
Exemplo n.º 8
0
class UserMovieGroupSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = models.AddedMovieGroup

    movie_group = ma.Nested(MovieGroupSchema, exclude=('movies', ))
    movies = ma.Nested(UserMovieSchema, many=True)
Exemplo n.º 9
0
class MovieGroupSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = models.MovieGroup
        exclude = ['ModifiedDate', 'ModifiedBy', 'CreatedDate', 'CreatedBy']

    movies = ma.Nested(MovieSchema, many=True)
Exemplo n.º 10
0
class UserMovieSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = models.AddedMovie
        exclude = ['ModifiedDate', 'ModifiedBy', 'CreatedDate', 'CreatedBy']

    movie = ma.Nested(MovieSchema)