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)
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)
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)
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)
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)
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)
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)
class PostLikeSchema(ma.SQLAlchemyAutoSchema): class Meta: model = PostLike post = ma.Nested(PostSchema) user = ma.Nested(UserSchema) created_at = ma.DateTime()
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)
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)
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)
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)
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()
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)
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"])])
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)
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)
class PointSchema(ma.SQLAlchemyAutoSchema): class Meta: model = Fine creation_time = ma.DateTime(required=True)