Exemplo n.º 1
0
class RepositoryFilesSchema(MarshmallowBase):
    # TODO: Add exlude=[] parameter here to skip redundant date and id fields.
    file_patch = ma.Method('get_patch')

    def get_patch(self, obj):
        return 'DEPRECATED'

    markers = ma.Nested(RepositoryFileMarkersSchema, many=True)
    comments = ma.Nested(RepositoryFileCommentsSchema, many=True)

    class Meta(MarshmallowBase.Meta):
        model = RepositoryFiles
Exemplo n.º 2
0
class RepositoryFilesSchema(MarshmallowBase):
    # TODO: Add exlude=[] parameter here to skip redundant date and id fields.
    # pylint: disable=no-member
    file_patch = ma.Method("get_patch")
    markers = ma.Nested(RepositoryFileMarkersSchema, many=True)
    comments = ma.Nested(RepositoryFileCommentsSchema, many=True)
    # pylint: enable=no-member

    @staticmethod
    def get_patch(obj):
        del obj
        return "DEPRECATED"

    class Meta(MarshmallowBase.Meta):
        model = RepositoryFiles