colorize spaces

This commit is contained in:
Laura Klünder 2017-05-13 16:39:01 +02:00
parent 16556c104a
commit 6512ef7905
4 changed files with 49 additions and 18 deletions

View file

@ -77,6 +77,16 @@ class Space(SpecificLocation, LevelSectionGeometryMixin, models.Model):
result['public'] = self.public
return result
def get_color(self):
color = {
'stairs': '#dddddd',
'escalator': '#a9a9a9',
'elevator': '#00ffff',
}.get(self.category)
if not color:
color = super().get_color()
return color
class Door(LevelSectionGeometryMixin, models.Model):
"""