shortwaytypeschema needs no explicit serialization
This commit is contained in:
parent
3fc1bfa5ed
commit
26ea7c7152
1 changed files with 1 additions and 5 deletions
|
@ -1,13 +1,10 @@
|
||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
import copy
|
|
||||||
from collections import OrderedDict, deque
|
from collections import OrderedDict, deque
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from c3nav.routing.api.routing import ShortWayTypeSchema
|
|
||||||
|
|
||||||
|
|
||||||
def describe_location(location, locations):
|
def describe_location(location, locations):
|
||||||
if location.can_describe:
|
if location.can_describe:
|
||||||
|
@ -242,8 +239,7 @@ class RouteItem:
|
||||||
result = OrderedDict((
|
result = OrderedDict((
|
||||||
('id', self.node.pk),
|
('id', self.node.pk),
|
||||||
('coordinates', (self.node.x, self.node.y, self.node.altitude)),
|
('coordinates', (self.node.x, self.node.y, self.node.altitude)),
|
||||||
('waytype', (ShortWayTypeSchema.model_validate(self.route.router.waytypes[self.edge.waytype]).model_dump()
|
('waytype', (self.route.router.waytypes[self.edge.waytype] if self.edge and self.edge.waytype else None)),
|
||||||
if self.edge and self.edge.waytype else None)),
|
|
||||||
))
|
))
|
||||||
if self.waytype:
|
if self.waytype:
|
||||||
result['waytype'] = self.waytype.serialize(detailed=False)
|
result['waytype'] = self.waytype.serialize(detailed=False)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue