Implemented upload
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
from .default_schema import DefaultSchema
|
||||
from .aimodel_schema import AIModelSchema
|
||||
from .info_schema import InfoSchema
|
15
model_service/schemas/info_schema.py
Normal file
15
model_service/schemas/info_schema.py
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
from marshmallow import fields, Schema
|
||||
from marshmallow.utils import get_value, missing
|
||||
from marshmallow.validate import OneOf
|
||||
|
||||
import uuid
|
||||
|
||||
|
||||
class InfoSchema(Schema):
|
||||
id = fields.UUID(default=uuid.uuid4, missing=uuid.uuid4)
|
||||
type = fields.String(validate=OneOf(['svm', 'svm_rbf', 'knn', 'extratrees', 'gradientboosting', 'randomforest']))
|
||||
|
||||
@classmethod # This threats none values as missing
|
||||
def get_attribute(cls, attr, obj, default):
|
||||
return get_value(attr, obj, default=default) or missing
|
Reference in New Issue
Block a user