|
16 | 16 | from api.models.widget_timeline import WidgetTimeline as WidgetTimelineModel |
17 | 17 | from api.models.timeline_event import TimelineEvent as TimelineEventModel |
18 | 18 |
|
19 | | -from marshmallow import Schema |
20 | 19 | from marshmallow_sqlalchemy.fields import Nested |
| 20 | +from .base_schema import BaseSchema |
21 | 21 |
|
22 | 22 |
|
23 | | -class TimelineEventSchema(Schema): # pylint: disable=too-many-ancestors, too-few-public-methods |
| 23 | +class TimelineEventSchema(BaseSchema): # pylint: disable=too-many-ancestors, too-few-public-methods |
24 | 24 | """This is the schema for the timeline event model.""" |
25 | 25 |
|
26 | | - class Meta: # pylint: disable=too-few-public-methods |
| 26 | + class Meta(BaseSchema.Meta): # pylint: disable=too-few-public-methods |
27 | 27 | """All of the fields in the Timeline Event schema.""" |
28 | 28 |
|
29 | 29 | model = TimelineEventModel |
| 30 | + include_fk = True |
30 | 31 | fields = ('id', 'engagement_id', 'widget_id', 'timeline_id', 'description', 'time', 'position', 'status') |
31 | 32 |
|
32 | 33 |
|
33 | | -class WidgetTimelineSchema(Schema): # pylint: disable=too-many-ancestors, too-few-public-methods |
| 34 | +class WidgetTimelineSchema(BaseSchema): # pylint: disable=too-many-ancestors, too-few-public-methods |
34 | 35 | """This is the schema for the widget timeline model.""" |
35 | 36 |
|
36 | | - class Meta: # pylint: disable=too-few-public-methods |
| 37 | + class Meta(BaseSchema.Meta): # pylint: disable=too-few-public-methods |
37 | 38 | """All of the fields in the Widget Timeline schema.""" |
38 | 39 |
|
39 | 40 | model = WidgetTimelineModel |
| 41 | + include_fk = True |
40 | 42 | fields = ('id', 'engagement_id', 'widget_id', 'title', 'description', 'events') |
41 | 43 |
|
42 | 44 | events = Nested(TimelineEventSchema, many=True) |
0 commit comments