mirror of
https://github.com/sartography/protocol-builder-mock.git
synced 2025-02-20 19:38:10 +00:00
Schema for the new UVA StudyCreator endpoint
This commit is contained in:
parent
6beab02a72
commit
55fd3ec59a
14
pb/models.py
14
pb/models.py
@ -283,6 +283,20 @@ class IRBStatusSchema(ma.Schema):
|
||||
fields = ("STATUS", "DETAIL")
|
||||
|
||||
|
||||
class CreatorStudySchema(ma.Schema):
|
||||
class Meta:
|
||||
model = Study
|
||||
include_relationships = True
|
||||
load_instance = True
|
||||
fields = ["STUDYID", "TITLE", "DATECREATED", "DATELASTMODIFIED"]
|
||||
DATECREATED = DATELASTMODIFIED = fields.Method("get_dates")
|
||||
|
||||
@staticmethod
|
||||
def get_dates(obj):
|
||||
if obj is not None and hasattr(obj, "DATE_MODIFIED"):
|
||||
return obj.DATE_MODIFIED
|
||||
|
||||
|
||||
class StudySchema(ma.Schema):
|
||||
class Meta:
|
||||
include_relationships = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user