Esempio n. 1
0
class LineSerializer(NestedDictGenericField):
    code = StringNestedPropertyField(display_none=False, attr='code')
    commercial_mode = DictGenericSerializer()
    physical_modes = DictGenericSerializer(many=True)
    network = DictGenericSerializer()
    color = StringNestedPropertyField(display_none=False, attr='color')
    text_color = StringNestedPropertyField(display_none=False,
                                           attr='text_color')
Esempio n. 2
0
class PlacesCommonSerializer(serpy.DictSerializer):
    '''
    Warning: This class share it's interface with PlaceSerializer (for Kraken)
    If you add/modify fields here, please reflect your changes in
    'jormungandr.jormungandr.interfaces.v1.serializer.pt.PlaceSerializer'.
    '''

    id = NestedPropertyField(attr='properties.geocoding.id', display_none=True)
    name = NestedPropertyField(attr='properties.geocoding.name', display_none=True)
    quality = LiteralField(0, deprecated=True)
    distance = StringNestedPropertyField(attr='distance', display_none=False, required=False)
    embedded_type = LiteralField("administrative_region", display_none=True)