Beispiel #1
0
class PtObjectsSerializer(serpy.Serializer):
    error = ErrorSerializer(display_none=False)
    feed_publishers = FeedPublisherSerializer(many=True, display_none=True)
    disruptions = pt.DisruptionSerializer(attr='impacts', many=True, display_none=True)
    pt_objects = pt.PtObjectSerializer(many=True, attr='places')
    links = DescribedField(schema_type=LinkSchema(many=True))
    context = MethodField(schema_type=ContextSerializer(), display_none=False)

    def get_context(self, obj):
        return ContextSerializer(obj, False, display_none=False).data
Beispiel #2
0
class LineReportSerializer(PbNestedSerializer):
    line = pt.LineSerializer()
    pt_objects = pt.PtObjectSerializer(many=True, display_none=True)
Beispiel #3
0
class PtObjectsSerializer(serpy.Serializer):
    error = ErrorSerializer(display_none=False)
    feed_publishers = FeedPublisherSerializer(many=True, display_none=True)
    disruptions = pt.DisruptionSerializer(attr='impacts', many=True, display_none=True)
    pt_objects = pt.PtObjectSerializer(many=True, attr='places')