mirror of
https://github.com/sartography/protocol-builder-mock.git
synced 2025-01-12 00:34:44 +00:00
Jeff made a modification to the API endpoints so we can reduce the number of calls we need to make. Just mimicing that adjustment in our mock api.
This commit is contained in:
parent
0afce84180
commit
29be81126a
@ -288,14 +288,20 @@ class CreatorStudySchema(ma.Schema):
|
||||
model = Study
|
||||
include_relationships = True
|
||||
load_instance = True
|
||||
fields = ["STUDYID", "TITLE", "DATECREATED", "DATELASTMODIFIED"]
|
||||
fields = ["STUDYID", "TITLE", "DATECREATED", "DATELASTMODIFIED", "REVIEW_TYPE"]
|
||||
DATECREATED = DATELASTMODIFIED = fields.Method("get_dates")
|
||||
REVIEW_TYPE = fields.Method("get_review_type")
|
||||
|
||||
@staticmethod
|
||||
def get_dates(obj):
|
||||
if obj is not None and hasattr(obj, "DATE_MODIFIED"):
|
||||
return obj.DATE_MODIFIED
|
||||
|
||||
@staticmethod
|
||||
def get_review_type(obj):
|
||||
if obj is not None and hasattr(obj, "study_details"):
|
||||
return obj.study_details.REVIEW_TYPE
|
||||
|
||||
|
||||
class StudySchema(ma.Schema):
|
||||
class Meta:
|
||||
|
Loading…
x
Reference in New Issue
Block a user