コード例 #1
0
class EquipmentOrderSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = EquipmentOrder

    order_return_date_estimate = ma.DateTime(required=False)
    order_actual_return_date = ma.DateTime(required=False)
    order_active = ma.Boolean(required=True, default=True)
コード例 #2
0
class PostSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Post

    caption = ma.String()
    created_at = ma.DateTime()
    updated_at = ma.DateTime()
    total_likes = ma.Integer()
    total_dislikes = ma.Integer()
    total_comments = ma.Integer()
    user = ma.Nested(UserSchema)
コード例 #3
0
class StudyHistorySchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = StudyHistory

    qualification_title = ma.String(required=True)
    institution = ma.String(required=True)
    city = ma.String(required=True)
    country = ma.String(required=True)
    date_start = ma.DateTime(required=True)
    date_end = ma.DateTime(required=True)
    last_updated = ma.DateTime(required=True)
    user = ma.Nested(user_schema)
コード例 #4
0
class ITNewsSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = ITNews

    article_link = ma.Url(required=True)
    photo_link = ma.Url(required=True)
    published_time = ma.DateTime(required=True,
                                 nullable=False,
                                 default=datetime.utcnow)
    last_updated = ma.DateTime(required=True,
                               nullable=False,
                               default=datetime.utcnow)
コード例 #5
0
class WorkHistorySchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = WorkHistory

    job_title = ma.String(required=True)
    company = ma.String(required=True)
    city = ma.String(required=True)
    country = ma.String(required=True)
    date_start = ma.DateTime(required=True)
    date_end = ma.DateTime(required=True)
    last_updated = ma.DateTime(required=True)
    user = ma.Nested(user_schema)
コード例 #6
0
class MeetingSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Meeting

    time_start = ma.DateTime(required=True)
    time_end = ma.DateTime(required=True)
    location = ma.String(required=True)
    subject = ma.String(required=True)
    description = ma.String(required=True)
    last_updated = ma.DateTime(required=True,
                               nullable=False,
                               default=datetime.utcnow)
    user = ma.Nested(user_schema)
コード例 #7
0
class UserSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = User
        load_only = ["password"]
    username = ma.String(required=True, validate=Length(min=4))
    first_name = ma.String(required=True, validate=Length(min=2))
    last_name = ma.String(required=True, validate=Length(min=2))
    created_at = ma.DateTime(required=True)
    dob = ma.DateTime(required=True)
    email = ma.String(required=True, validate=Email())
    mobile = ma.String()
    city = ma.String(required=True)
    country = ma.String(required=True)
    password = ma.String(required=True)
コード例 #8
0
class PostLikeSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = PostLike

    post = ma.Nested(PostSchema)
    user = ma.Nested(UserSchema)
    created_at = ma.DateTime()
コード例 #9
0
ファイル: SprintSchema.py プロジェクト: brucemcclure/demo_app
class SprintSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Sprint

    title = ma.String(required=True, validate=Length(min=1))
    meeting_point = ma.String(required=True, validate=Length(min=1))
    creation_time = ma.DateTime(required=True)
コード例 #10
0
class ImageSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Image
    
    username = ma.String(required=True, validate=Length(min=4))
    path = ma.String(required=True)
    last_updated = ma.DateTime(required=True,nullable=False, default=datetime.utcnow)
コード例 #11
0
class ResumeProjectSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = ResumeProject

    resume_path = ma.String(required=True)
    github_account = ma.Url(required=True)
    last_updated = ma.DateTime(required=True)
    user = ma.Nested(user_schema)
コード例 #12
0
class MediaSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Media

    caption = ma.String()
    media_url = ma.String(required=True, validate=Length(min=5))
    permalink = ma.String()
    thumbnail_url = ma.String(required=True)
    timestamp = ma.DateTime(required=True)
コード例 #13
0
ファイル: UserSchema.py プロジェクト: sam-don/t3a3
class UserSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = User
        load_only = ["password"]

    email = ma.String(required=True, validate=[Length(min=4), Email()])
    name = ma.String(validate=[Length(min=1)])
    password = ma.String(required=True, validate=Length(min=6))
    created_at = ma.DateTime()
コード例 #14
0
class PostSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Post

    username = ma.String(required=True, validate=Length(min=4))
    content = ma.String(required=True)
    likes = ma.Integer(default=0, validate=Range(min=0))
    last_updated = ma.DateTime(required=True,
                               nullable=False,
                               default=datetime.utcnow)
コード例 #15
0
class ConnectionSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Connection

    requester = ma.Nested(user_schema)
    confirmer = ma.Nested(user_schema)
    last_updated = ma.DateTime(default=datetime.utcnow)
    user_1_approved = ma.Boolean(default=True)
    user_2_approved = ma.Boolean(default=False)
    status = ma.String(default='pending',
                       validate=[OneOf(["pending", "confirmed"])])
コード例 #16
0
class MessageSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Message

    sender = ma.Nested(user_schema)
    receiver = ma.Nested(user_schema)
    content = ma.String(required=True, validate=validate.Length(min=10))
    read = ma.Boolean(default=False)
    liked = ma.Boolean(default=False)
    sent_time = ma.DateTime(required=True,
                            nullable=False,
                            default=datetime.utcnow)
コード例 #17
0
class AlbumsSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Album

    album_name = ma.String(required=False, validate=Length(min=1, max=100))
    date_released = ma.DateTime(required=False)
コード例 #18
0
ファイル: PointSchema.py プロジェクト: brucemcclure/demo_app
class PointSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Fine

    creation_time = ma.DateTime(required=True)