move Area.stuffed into a Location Group
This commit is contained in:
parent
09fe696b49
commit
d2859f1452
3 changed files with 33 additions and 9 deletions
|
@ -50,7 +50,6 @@ class Area(SpecificLocation, SpaceGeometryMixin, models.Model):
|
|||
An area in a space.
|
||||
"""
|
||||
geometry = GeometryField('polygon')
|
||||
stuffed = models.BooleanField(verbose_name=_('stuffed area'), default=False)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Area')
|
||||
|
@ -59,15 +58,8 @@ class Area(SpecificLocation, SpaceGeometryMixin, models.Model):
|
|||
|
||||
def _serialize(self, **kwargs):
|
||||
result = super()._serialize(**kwargs)
|
||||
result['stuffed'] = self.stuffed
|
||||
return result
|
||||
|
||||
def get_color(self, *args, **kwargs):
|
||||
color = super().get_color(*args, **kwargs)
|
||||
if not color and self.stuffed:
|
||||
color = 'rgba(0, 0, 0, 0.04)'
|
||||
return color
|
||||
|
||||
|
||||
class Stair(SpaceGeometryMixin, models.Model):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue