fix location_id of PointLocation
This commit is contained in:
parent
e3990fcaf0
commit
8a9406275b
2 changed files with 3 additions and 2 deletions
|
@ -238,7 +238,7 @@ def get_location(request, name):
|
|||
level = levels.get(match.group('level'))
|
||||
if level is None:
|
||||
return None
|
||||
return PointLocation(level=level, x=int(match.group('x')), y=int(match.group('y')))
|
||||
return PointLocation(level=level, x=int(match.group('x'))/100, y=int(match.group('y'))/100)
|
||||
|
||||
if name.startswith('g:'):
|
||||
return filter_queryset_by_package_access(request, LocationGroup.objects.filter(name=name[2:])).first()
|
||||
|
@ -282,7 +282,7 @@ class PointLocation(Location):
|
|||
|
||||
@cached_property
|
||||
def location_id(self):
|
||||
return 'c:%s:%d:%d' % (self.level.name, self.x, self.y)
|
||||
return 'c:%s:%d:%d' % (self.level.name, self.x*100, self.y*100)
|
||||
|
||||
@property
|
||||
def title(self) -> str:
|
||||
|
|
|
@ -242,6 +242,7 @@ class Graph:
|
|||
|
||||
def get_location_points(self, location: Location):
|
||||
if isinstance(location, PointLocation):
|
||||
return self.levels[level.name].points_from()
|
||||
return 'bla'
|
||||
elif isinstance(location, AreaLocation):
|
||||
return self.levels[location.level.name].arealocation_points[location.name]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue