add space and obstacle heights
This commit is contained in:
parent
1a779fbcc4
commit
055df254e2
5 changed files with 59 additions and 3 deletions
|
@ -57,6 +57,7 @@ class Space(SpecificLocation, LevelGeometryMixin, models.Model):
|
|||
An accessible space. Shouldn't overlap with spaces on the same level.
|
||||
"""
|
||||
geometry = GeometryField('polygon')
|
||||
height = models.DecimalField(_('height'), max_digits=6, decimal_places=2, null=True, blank=True)
|
||||
outside = models.BooleanField(default=False, verbose_name=_('only outside of building'))
|
||||
|
||||
class Meta:
|
||||
|
@ -64,6 +65,11 @@ class Space(SpecificLocation, LevelGeometryMixin, models.Model):
|
|||
verbose_name_plural = _('Spaces')
|
||||
default_related_name = 'spaces'
|
||||
|
||||
def _serialize(self, geometry=True, **kwargs):
|
||||
result = super()._serialize(geometry=geometry, **kwargs)
|
||||
result['height'] = None if self.height is None else float(str(self.height))
|
||||
return result
|
||||
|
||||
|
||||
class Door(AccessRestrictionMixin, LevelGeometryMixin, models.Model):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue