From 2d3d67403c7fbbe044dfe1dc85140bc92b682995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Mon, 10 Jul 2017 18:55:35 +0200 Subject: [PATCH] add single, allow_* and priority to LocationGroupCategory --- .../migrations/0020_auto_20170710_1848.py | 51 +++++++++++++++++++ src/c3nav/mapdata/models/locations.py | 6 +++ 2 files changed, 57 insertions(+) create mode 100644 src/c3nav/mapdata/migrations/0020_auto_20170710_1848.py diff --git a/src/c3nav/mapdata/migrations/0020_auto_20170710_1848.py b/src/c3nav/mapdata/migrations/0020_auto_20170710_1848.py new file mode 100644 index 00000000..101e34c0 --- /dev/null +++ b/src/c3nav/mapdata/migrations/0020_auto_20170710_1848.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.2 on 2017-07-10 16:48 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('mapdata', '0019_location_group_category'), + ] + + operations = [ + migrations.AddField( + model_name='locationgroupcategory', + name='allow_areas', + field=models.BooleanField(db_index=True, default=True, verbose_name='allow areas'), + ), + migrations.AddField( + model_name='locationgroupcategory', + name='allow_levels', + field=models.BooleanField(db_index=True, default=True, verbose_name='allow levels'), + ), + migrations.AddField( + model_name='locationgroupcategory', + name='allow_pois', + field=models.BooleanField(db_index=True, default=True, verbose_name='allow pois'), + ), + migrations.AddField( + model_name='locationgroupcategory', + name='allow_spaces', + field=models.BooleanField(db_index=True, default=True, verbose_name='allow spaces'), + ), + migrations.AddField( + model_name='locationgroupcategory', + name='priority', + field=models.IntegerField(db_index=True, default=0), + ), + migrations.AddField( + model_name='locationgroupcategory', + name='single', + field=models.BooleanField(default=False, verbose_name='single selection'), + ), + migrations.AlterField( + model_name='locationgroup', + name='category', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='groups', to='mapdata.LocationGroupCategory', verbose_name='Category'), + ), + ] diff --git a/src/c3nav/mapdata/models/locations.py b/src/c3nav/mapdata/models/locations.py index cab6cf04..d9aa452d 100644 --- a/src/c3nav/mapdata/models/locations.py +++ b/src/c3nav/mapdata/models/locations.py @@ -153,6 +153,12 @@ class SpecificLocation(Location, models.Model): class LocationGroupCategory(TitledMixin, models.Model): name = models.SlugField(_('Name'), unique=True, max_length=50) + single = models.BooleanField(_('single selection'), default=False) + allow_levels = models.BooleanField(_('allow levels'), db_index=True, default=True) + allow_spaces = models.BooleanField(_('allow spaces'), db_index=True, default=True) + allow_areas = models.BooleanField(_('allow areas'), db_index=True, default=True) + allow_pois = models.BooleanField(_('allow pois'), db_index=True, default=True) + priority = models.IntegerField(default=0, db_index=True) class Meta: verbose_name = _('Location Group Category')