rename StuffedArea to Area with boolean field „stuffed“
This commit is contained in:
parent
af30d9532b
commit
47d2616469
4 changed files with 50 additions and 5 deletions
23
src/c3nav/mapdata/migrations/0067_auto_20170510_1311.py
Normal file
23
src/c3nav/mapdata/migrations/0067_auto_20170510_1311.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.10.7 on 2017-05-10 13:11
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mapdata', '0066_auto_20170509_1148'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameModel(
|
||||||
|
old_name='StuffedArea',
|
||||||
|
new_name='Area',
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='area',
|
||||||
|
options={'verbose_name': 'Area', 'verbose_name_plural': 'Areas'},
|
||||||
|
),
|
||||||
|
]
|
21
src/c3nav/mapdata/migrations/0068_area_stuffed.py
Normal file
21
src/c3nav/mapdata/migrations/0068_area_stuffed.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.10.7 on 2017-05-10 13:11
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mapdata', '0067_auto_20170510_1311'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='area',
|
||||||
|
name='stuffed',
|
||||||
|
field=models.BooleanField(default=True, verbose_name='stuffed area'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
|
@ -1,5 +1,5 @@
|
||||||
from .section import Section # noqa
|
from .section import Section # noqa
|
||||||
from .source import Source # noqa
|
from .source import Source # noqa
|
||||||
from c3nav.mapdata.models.geometry.section import Building, Space, Hole, Door # noqa
|
from c3nav.mapdata.models.geometry.section import Building, Space, Hole, Door # noqa
|
||||||
from c3nav.mapdata.models.geometry.space import StuffedArea, Stair, Obstacle, LineObstacle # noqa
|
from c3nav.mapdata.models.geometry.space import Area, Stair, Obstacle, LineObstacle # noqa
|
||||||
from .locations import AreaLocation, LocationGroup # noqa
|
from .locations import AreaLocation, LocationGroup # noqa
|
||||||
|
|
|
@ -23,15 +23,16 @@ class SpaceGeometryMixin(GeometryMixin):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
class StuffedArea(SpaceGeometryMixin, models.Model):
|
class Area(SpaceGeometryMixin, models.Model):
|
||||||
"""
|
"""
|
||||||
A slow area with many tables or similar. Avoid it from routing by slowing it a bit down
|
An area in a space.
|
||||||
"""
|
"""
|
||||||
geometry = GeometryField('polygon')
|
geometry = GeometryField('polygon')
|
||||||
|
stuffed = models.BooleanField(verbose_name=_('stuffed area'))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('Stuffed Area')
|
verbose_name = _('Area')
|
||||||
verbose_name_plural = _('Stuffed Areas')
|
verbose_name_plural = _('Areas')
|
||||||
default_related_name = 'stuffedareas'
|
default_related_name = 'stuffedareas'
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue