user handling done
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-11-24 20:26:02 +01:00
parent f54d752657
commit e02bf1aa62
9 changed files with 207 additions and 7 deletions

38
src/schemas.py Normal file
View File

@ -0,0 +1,38 @@
#!/usr/bin/env python3
from flask_marshmallow.sqla import auto_field
from models import User
from marshm import ma
from marshmallow import fields
"""
Marshmallow schemas
"""
__author__ = "@tormakris"
__copyright__ = "Copyright 2020, videON Team"
__module_name__ = "schemas"
__version__text__ = "1"
class UserSchema(ma.Schema):
"""
Parameters:
- name (string)
- passowrd (string)
"""
name = fields.String(required=True)
password = fields.String(required=True)
class UserMetadataSchema(ma.SQLAlchemyAutoSchema):
"""
Marshmallow schema generated
"""
class Meta:
model = User
exclude = ('timestamp', 'password',)
creation_date = auto_field("timestamp", dump_only=False)