api endpoint to list waytypes
This commit is contained in:
parent
b9c1695463
commit
e5fab0611b
2 changed files with 14 additions and 3 deletions
|
@ -11,7 +11,7 @@ from c3nav.api.exceptions import API404
|
||||||
from c3nav.api.schema import BaseSchema
|
from c3nav.api.schema import BaseSchema
|
||||||
from c3nav.mapdata.api.base import api_etag, optimize_query, can_access_geometry
|
from c3nav.mapdata.api.base import api_etag, optimize_query, can_access_geometry
|
||||||
from c3nav.mapdata.models import (Area, Building, Door, Hole, Level, LocationGroup, LocationGroupCategory, Source,
|
from c3nav.mapdata.models import (Area, Building, Door, Hole, Level, LocationGroup, LocationGroupCategory, Source,
|
||||||
Space, Stair, DataOverlay, DataOverlayFeature)
|
Space, Stair, DataOverlay, DataOverlayFeature, WayType)
|
||||||
from c3nav.mapdata.models.access import AccessRestriction, AccessRestrictionGroup
|
from c3nav.mapdata.models.access import AccessRestriction, AccessRestrictionGroup
|
||||||
from c3nav.mapdata.models.geometry.space import (POI, Column, CrossDescription, LeaveDescription, LineObstacle,
|
from c3nav.mapdata.models.geometry.space import (POI, Column, CrossDescription, LeaveDescription, LineObstacle,
|
||||||
Obstacle, Ramp)
|
Obstacle, Ramp)
|
||||||
|
@ -24,7 +24,8 @@ from c3nav.mapdata.schemas.models import (AccessRestrictionGroupSchema, AccessRe
|
||||||
DynamicLocationSchema, HoleSchema, LeaveDescriptionSchema, LevelSchema,
|
DynamicLocationSchema, HoleSchema, LeaveDescriptionSchema, LevelSchema,
|
||||||
LineObstacleSchema, LocationGroupCategorySchema, LocationGroupSchema,
|
LineObstacleSchema, LocationGroupCategorySchema, LocationGroupSchema,
|
||||||
ObstacleSchema, POISchema, RampSchema, SourceSchema, SpaceSchema, StairSchema,
|
ObstacleSchema, POISchema, RampSchema, SourceSchema, SpaceSchema, StairSchema,
|
||||||
DataOverlaySchema, DataOverlayFeatureSchema, LocationRedirectSchema)
|
DataOverlaySchema, DataOverlayFeatureSchema, LocationRedirectSchema,
|
||||||
|
WayTypeSchema)
|
||||||
|
|
||||||
mapdata_api_router = APIRouter(tags=["mapdata"])
|
mapdata_api_router = APIRouter(tags=["mapdata"])
|
||||||
|
|
||||||
|
@ -224,6 +225,10 @@ mapdata_endpoints: dict[str, list[MapdataEndpoint]] = {
|
||||||
schema=DataOverlayFeatureSchema,
|
schema=DataOverlayFeatureSchema,
|
||||||
filters=ByOverlayFilter,
|
filters=ByOverlayFilter,
|
||||||
),
|
),
|
||||||
|
MapdataEndpoint(
|
||||||
|
model=WayType,
|
||||||
|
schema=WayTypeSchema,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
"level": [
|
"level": [
|
||||||
MapdataEndpoint(
|
MapdataEndpoint(
|
||||||
|
|
|
@ -393,6 +393,12 @@ class DataOverlayFeatureSchema(TitledSchema, WithGeometrySchema, DjangoModelSche
|
||||||
extra_data: Optional[dict[str, str]]
|
extra_data: Optional[dict[str, str]]
|
||||||
|
|
||||||
|
|
||||||
|
class WayTypeSchema(TitledSchema, DjangoModelSchema):
|
||||||
|
"""
|
||||||
|
Waytypes for navigation like stairs, escalators etc
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
class SourceSchema(WithAccessRestrictionSchema, DjangoModelSchema):
|
class SourceSchema(WithAccessRestrictionSchema, DjangoModelSchema):
|
||||||
"""
|
"""
|
||||||
A source image that can be traced in the editor.
|
A source image that can be traced in the editor.
|
||||||
|
@ -971,4 +977,4 @@ class LegendItemSchema(BaseSchema):
|
||||||
class LegendSchema(BaseSchema):
|
class LegendSchema(BaseSchema):
|
||||||
base: list[LegendItemSchema]
|
base: list[LegendItemSchema]
|
||||||
groups: list[LegendItemSchema]
|
groups: list[LegendItemSchema]
|
||||||
obstacles: list[LegendItemSchema]
|
obstacles: list[LegendItemSchema]
|
Loading…
Add table
Add a link
Reference in a new issue