Merge pull request #73 from sartography/feature/study_dashboard_performance

Jeff made a modification to the API endpoints so we can reduce the nu…
This commit is contained in:
Dan Funk 2022-03-18 16:41:24 -04:00 committed by GitHub
commit 77352de3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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: