Beispiel #1
0
class StandingSchema(SQLAlchemyAutoSchema):
    team = fields.Nested(TeamSchema)
    stage = fields.Nested(StageSchema)

    class Meta:
        model = Standing
        include_fk = True
Beispiel #2
0
class ComSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Commentaire
        sqla_session = db.session

    user = fields.Nested('ComUserSchema', default=None)
    sortie = fields.Nested('ComSortieSchema', default=None)
Beispiel #3
0
class TaskSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Task
        load_instance = True
        include_fk = True

    user = fields.Nested(UserSchema())
    project = fields.Nested(ProjectSchema())
Beispiel #4
0
class MessageSchema(SQLAlchemyAutoSchema):
    sender = fields.Nested(UserSchema)
    receiver = fields.Nested(UserSchema)
    created_at = marshmallow_fields.String(data_key="createdAt")

    class Meta:
        fields = ("id", "subject", "message", "created_at", "sender",
                  "receiver")
Beispiel #5
0
class ProjectSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Project
        load_instance = True
        include_fk = True

    user = fields.Nested(UserSchema())
    project_team = fields.Nested(TeamSchema(), many=True)
Beispiel #6
0
class SortieSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Sortie
        sqla_session = db.session
        load_instance = True

    commentaires = fields.Nested('SortieComSchema', default=[], many=True)
    participants = fields.Nested('SortieUserSchema', default=[], many=True)
class ArticlePutPostSchema(ArticleSchema):
    """
    Schema for put/post methods for Article Model
    """

    tags = sqlalchemy_fields.Nested(TagSchema, many=True, only=["id"])
    categories = sqlalchemy_fields.Nested(CategorySchema,
                                          many=True,
                                          only=["id"])
Beispiel #8
0
class UserSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = User
        sqla_session = db.session
        load_instance = True

    commentaires = fields.Nested('UserComSchema', default=[], many=True)
    sorties_a_venir = fields.Nested('UserSortieSchema', default=[], many=True)
    sorties_finies = fields.Nested('UserSortieSchema', default=[], many=True)
Beispiel #9
0
class FullUserSchema(UserSchema):
    active_pairing_sessions = fields.Nested(PairingSessionSchema, many=True)
    team = fields.Nested(TeamSchema)
    feedback_received = fields.Nested(FeedbackSchema, many=True)
    feedback_tag_groups = fields.Nested(FeedbackTagGroupSchema, many=True)

    class Meta:
        fields = ('id', 'active_pairing_sessions', 'team', 'username',
                  'full_name', 'uuid', 'feedback_received',
                  'feedback_tag_groups')
Beispiel #10
0
class MatchSchema(SQLAlchemyAutoSchema):
    homeTeam = fields.Nested(TeamSchema)
    awayTeam = fields.Nested(TeamSchema)
    tournament = fields.Nested(TournamentSchema)
    stage = fields.Nested(StageSchema)
    goals = fields.Nested(GoalSchema, many=True)

    class Meta:
        model = Match
        include_fk = True
Beispiel #11
0
class AssertionSchema(ma.Schema):
    class Meta:
        fields = ("assertion_id", "disease", "context", "oncotree_term",
                  "oncotree_code", "therapy_name", "therapy_strategy",
                  "therapy_type", "therapy_sensitivity", "therapy_resistance",
                  "favorable_prognosis", "predictive_implication",
                  "description", "last_updated", "sources", "features")

    sources = fields.Nested(SourceSchema, many=True, exclude=("assertions", ))
    features = fields.Nested(FeatureSchema, many=True)
Beispiel #12
0
class FeatureSchema(ma.Schema):
    class Meta:
        fields = ("attributes", "feature_definition", "feature_id")

    feature_definition = fields.Nested(FeatureDefinitionSchema,
                                       only=(
                                           "name",
                                           "attribute_definitions",
                                       ))
    attributes = fields.Nested(FeatureAttributeSchema,
                               many=True,
                               only=("value", ))
Beispiel #13
0
class UserSchema(SQLAlchemySchema):
    id = auto_field()
    name = auto_field()
    uid = auto_field()
    is_admin = auto_field()

    class Meta:
        model = User
        load_instance = True
        include_relationships = True

    values = fields.Nested(UserFieldValueSchema, many=True)
    group = fields.Nested(UserGroupSchema, many=False)
Beispiel #14
0
class ArticleSchema(ModelSchema):
    """
    ArticleModel BaseSchema
    """

    id = fields.Int(dump_only=True)
    tags = sqlalchemy_fields.Nested(TagSchema, many=True)
    categories = sqlalchemy_fields.Nested(CategorySchema, many=True)

    class Meta:
        """
        MetaClass for Article Schema
        """

        model = ArticleModel
Beispiel #15
0
class NotificationSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Notification
        load_instance = True
        include_fk = True

    user = fields.Nested(UserSchema())
Beispiel #16
0
class FeedbackTagGroupSchema(SQLAlchemyAutoSchema):
    class Meta:
        model = PairingSession
        include_relationships = True
        fields = ('id', 'name', 'tags')

    tags = fields.Nested(FeedbackTagSchema, many=True)
Beispiel #17
0
class TeamSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Team
        load_instance = True
        include_fk = True

    users = fields.Nested(UserSchema(), many=True)
Beispiel #18
0
class TicketSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Ticket
        load_instance = True
        include_fk = True

    comments = fields.Nested('TicketCommentSchema', many=True)
Beispiel #19
0
class VillageSchema(SQLAlchemyAutoSchema):
    class Meta:
        model = Village
        include_relationships = True
        load_instance = True
    
    ninjas = fields.Nested(NinjaSchema())
Beispiel #20
0
class CommentSchema(SQLAlchemyAutoSchema):
    class Meta:
        model = Comment

    text = auto_field(
        validate=validate.Length(min=1, max=Comment.max_text_length))
    user = fields.Nested(UserSchema, exclude=("email", "polls"))
Beispiel #21
0
class ConfigurationSchema(SQLAlchemyAutoSchema):
    detections = fields.Nested(DetectionTypesSchema, many=True)

    class Meta:
        model = Configuration
        include_relationships = True
        load_instance = True
Beispiel #22
0
class UserSchema(SQLAlchemyAutoSchema):
    class Meta:
        model = User
        fields = ('username', 'role', 'uuid', 'created_at', 'id', 'deleted',
                  'full_name')

    role = fields.Nested(RoleSchema)
Beispiel #23
0
class ProductSchema(SQLAlchemyAutoSchema):
    category = fields.Nested(CategorySchema, data_key="category")
    class Meta:
        model = Product
        load_instance = True
        sqla_session = db.session
        include_fk = True
Beispiel #24
0
class PairingSessionSchema(SQLAlchemyAutoSchema):
    class Meta:
        model = PairingSession
        include_relationships = True
        fields = ('info', 'streak', 'users', 'uuid', 'id', 'created_at')

    users = fields.Nested(UserSchema, many=True)
Beispiel #25
0
class KYCSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Kyc
        load_instance = True
        include_fk = True

    user = fields.Nested(UserSchema())
Beispiel #26
0
class UserSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = User
        load_instance = True
        exclude = ['password', 'uuid']
        include_fk = True

    tags = fields.Nested(TagSchema(), many=True)
class SectorSchema(ModelSchema):
    class Meta:
        model = Sector
        include_relationships = True
        include_fk = True
        load_instance = True

    children = fields.Nested('self', many=True)
Beispiel #28
0
class FeedSchema(SQLAlchemyAutoSchema):
    feed_type = EnumField(CamType, by_value=True)
    configuration = fields.Nested(ConfigurationSchema)

    class Meta:
        model = Feed
        include_relationships = True
        load_instance = True
Beispiel #29
0
class ReferralSchema(ma.SQLAlchemyAutoSchema):
    followUp = fields.Nested(FollowUpSchema)

    class Meta:
        include_fk = True
        model = Referral
        load_instance = True
        include_relationships = True
Beispiel #30
0
class FeatureDefinitionSchema(ma.Schema):
    class Meta:
        fields = ("attribute_definitions", "feature_def_id", "features",
                  "name", "readable_name")

    attribute_definitions = fields.Nested(FeatureAttributeDefinitionSchema,
                                          many=True,
                                          only=("name", ))