class JobSchema(ma.SQLAlchemySchema): class Meta: model = Job fields = ('job_id', 'title', 'skills') include_fk = True skills = ma.Nested(skill_schema, many=True) link = ma.Hyperlinks( ma.URLFor("job_api.job_detail_by_id", values=dict(id="<job_id>")))
class CandidateSchema(ma.SQLAlchemySchema): class Meta: model = Candidate fields = ('candidate_id', 'title', 'skills', 'link') include_fk = True skills = ma.Nested(skill_schema, many=True) link = ma.Hyperlinks( ma.URLFor("candidate_api.candidate_detail_by_id", values=dict(id="<candidate_id>")))
class IncidentWithUserSchema(ma.Schema): incident = ma.Nested(incident_schema) user = ma.Nested(user_limited_schema) status = ma.Nested(patient_status_schema) admin = ma.Nested(admin_limited_schema)
class EventFullInfoSchema(ma.Schema): event = ma.Nested(event_schema) admin = ma.Nested(admin_limited_schema) status = ma.Nested(event_status_schema)