Resolves marshmallow_sqlalchemy.ModelSchema deprecation warning
This commit is contained in:
parent
7d31bc24eb
commit
40e12f5ab5
|
@ -1,7 +1,7 @@
|
|||
import enum
|
||||
|
||||
from marshmallow_enum import EnumField
|
||||
from marshmallow_sqlalchemy import ModelSchema
|
||||
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
|
||||
from sqlalchemy import func
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
|
||||
|
@ -81,8 +81,10 @@ class FileModel(db.Model):
|
|||
latest_version = db.Column(db.Integer, default=0)
|
||||
|
||||
|
||||
class FileModelSchema(ModelSchema):
|
||||
class FileModelSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = FileModel
|
||||
load_instance = True
|
||||
include_relationships = True
|
||||
include_fk = True # Includes foreign keys
|
||||
type = EnumField(FileType)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from marshmallow_sqlalchemy import ModelSchema
|
||||
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
|
||||
|
||||
from crc import db
|
||||
|
||||
|
@ -16,9 +16,11 @@ class WorkflowStatsModel(db.Model):
|
|||
last_updated = db.Column(db.DateTime)
|
||||
|
||||
|
||||
class WorkflowStatsModelSchema(ModelSchema):
|
||||
class WorkflowStatsModelSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = WorkflowStatsModel
|
||||
load_instance = True
|
||||
include_relationships = True
|
||||
include_fk = True # Includes foreign keys
|
||||
|
||||
|
||||
|
@ -35,7 +37,9 @@ class TaskEventModel(db.Model):
|
|||
date = db.Column(db.DateTime)
|
||||
|
||||
|
||||
class TaskEventModelSchema(ModelSchema):
|
||||
class TaskEventModelSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = TaskEventModel
|
||||
load_instance = True
|
||||
include_relationships = True
|
||||
include_fk = True # Includes foreign keys
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from marshmallow_enum import EnumField
|
||||
from marshmallow_sqlalchemy import ModelSchema
|
||||
from sqlalchemy import func, Column
|
||||
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
|
||||
from sqlalchemy import func
|
||||
|
||||
from crc import db
|
||||
from crc.models.protocol_builder import ProtocolBuilderStatus
|
||||
|
@ -24,9 +24,11 @@ class StudyModel(db.Model):
|
|||
status_spec_version = db.Column(db.String)
|
||||
|
||||
|
||||
class StudyModelSchema(ModelSchema):
|
||||
class StudyModelSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = StudyModel
|
||||
load_instance = True
|
||||
include_relationships = True
|
||||
include_fk = True # Includes foreign keys
|
||||
|
||||
protocol_builder_status = EnumField(ProtocolBuilderStatus)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import datetime
|
||||
|
||||
import jwt
|
||||
from marshmallow_sqlalchemy import ModelSchema
|
||||
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
|
||||
|
||||
from crc import db, app
|
||||
from crc.api.common import ApiError
|
||||
|
@ -52,7 +52,9 @@ class UserModel(db.Model):
|
|||
raise ApiError('token_invalid', 'The Authentication token you provided. You need a new token. ')
|
||||
|
||||
|
||||
class UserModelSchema(ModelSchema):
|
||||
class UserModelSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = UserModel
|
||||
load_instance = True
|
||||
include_relationships = True
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import enum
|
||||
|
||||
from marshmallow_sqlalchemy import ModelSchema
|
||||
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
|
||||
|
||||
from crc import db
|
||||
|
||||
|
@ -11,9 +11,11 @@ class WorkflowSpecCategoryModel(db.Model):
|
|||
display_name = db.Column(db.String)
|
||||
|
||||
|
||||
class WorkflowSpecCategoryModelSchema(ModelSchema):
|
||||
class WorkflowSpecCategoryModelSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = WorkflowSpecCategoryModel
|
||||
load_instance = True
|
||||
include_relationships = True
|
||||
|
||||
|
||||
class WorkflowSpecModel(db.Model):
|
||||
|
@ -28,9 +30,11 @@ class WorkflowSpecModel(db.Model):
|
|||
is_status = db.Column(db.Boolean, default=False)
|
||||
|
||||
|
||||
class WorkflowSpecModelSchema(ModelSchema):
|
||||
class WorkflowSpecModelSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = WorkflowSpecModel
|
||||
load_instance = True
|
||||
include_relationships = True
|
||||
include_fk = True # Includes foreign keys
|
||||
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ class TestTasksApi(BaseTest):
|
|||
}
|
||||
workflow_api = self.complete_form(workflow, tasks[0], data)
|
||||
self.assertIsNotNone(workflow_api.next_task)
|
||||
self.assertEquals("EndEvent_0evb22x", workflow_api.next_task['name'])
|
||||
self.assertEqual("EndEvent_0evb22x", workflow_api.next_task['name'])
|
||||
self.assertTrue(workflow_api.status == WorkflowStatus.complete)
|
||||
rv = self.app.get('/v1.0/file?workflow_id=%i' % workflow.id, headers=self.logged_in_headers())
|
||||
self.assert_success(rv)
|
||||
|
|
|
@ -312,7 +312,7 @@ class TestWorkflowProcessor(BaseTest):
|
|||
workflow_model.bpmn_workflow_json = processor.serialize()
|
||||
processor2 = WorkflowProcessor(workflow_model)
|
||||
self.assertEqual("Step 1", processor2.bpmn_workflow.last_task.task_spec.description)
|
||||
self.assertNotEquals("# This is some documentation I wanted to add.",
|
||||
self.assertNotEqual("# This is some documentation I wanted to add.",
|
||||
processor2.bpmn_workflow.last_task.task_spec.documentation)
|
||||
|
||||
# You can do a soft update and get the right response.
|
||||
|
|
Loading…
Reference in New Issue