fixed customlocation pk to use level_index
This commit is contained in:
parent
fe98f5e618
commit
9590344be6
2 changed files with 2 additions and 2 deletions
|
@ -340,7 +340,7 @@ class SimpleGeometryLocationsSchema(BaseSchema):
|
||||||
|
|
||||||
CustomLocationID = Annotated[NonEmptyStr, APIField(
|
CustomLocationID = Annotated[NonEmptyStr, APIField(
|
||||||
title="custom location ID",
|
title="custom location ID",
|
||||||
pattern=r"c:[a-z0-9-_]+:(-?\d+(\.\d+)?):(-?\d+(\.\d+)?)$",
|
pattern=r"c:[a-z0-9-_.]+:(-?\d+(\.\d+)?):(-?\d+(\.\d+)?)$",
|
||||||
example="c:0:-7.23:12.34",
|
example="c:0:-7.23:12.34",
|
||||||
description="level short_name and x/y coordinates form the ID of a custom location"
|
description="level short_name and x/y coordinates form the ID of a custom location"
|
||||||
)]
|
)]
|
||||||
|
|
|
@ -291,7 +291,7 @@ class CustomLocation:
|
||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
x = round(self.x, 2)
|
x = round(self.x, 2)
|
||||||
y = round(self.y, 2)
|
y = round(self.y, 2)
|
||||||
self.pk = 'c:%s:%s:%s' % (self.level.short_label, x, y)
|
self.pk = 'c:%s:%s:%s' % (self.level.level_index, x, y)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def serialized_geometry(self):
|
def serialized_geometry(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue