Carry the level everywhere a position is drawn, and gate it per occurrence
This commit is contained in:
@@ -100,6 +100,22 @@ class Harness:
|
||||
self.ids = IdMap(idmap_path or default)
|
||||
self.source = Source()
|
||||
self.errors = []
|
||||
self._defaultlevelid = None
|
||||
|
||||
@property
|
||||
def defaultlevelid(self):
|
||||
"""The level imported map positions belong to (ADR-017).
|
||||
|
||||
The legacy schema predates levels: it has ONE floor plan, so every
|
||||
mapleft/maptop it carries is a coordinate on this site's default level.
|
||||
Importing them without a level produces markers the map refuses to draw
|
||||
- it will not guess a drawing for coordinates that do not name one.
|
||||
"""
|
||||
if self._defaultlevelid is None:
|
||||
from shopdb.core.models import MapLevel
|
||||
level = MapLevel.default_level()
|
||||
self._defaultlevelid = level.levelid if level else None
|
||||
return self._defaultlevelid
|
||||
|
||||
def _silence_sql_logging(self):
|
||||
import logging
|
||||
|
||||
Reference in New Issue
Block a user