color should be up to 32 characters, fix color migration

This commit is contained in:
Laura Klünder 2017-09-16 14:19:01 +02:00
parent 20abfe5ad5
commit 8731fd5f11
3 changed files with 27 additions and 2 deletions

View file

@ -2,7 +2,7 @@
# Generated by Django 1.11.2 on 2017-07-13 10:31
from __future__ import unicode_literals
from django.db import migrations
from django.db import migrations, models
def convert_stuffed_area_to_location_group(apps, schema_editor):
@ -24,6 +24,11 @@ class Migration(migrations.Migration):
]
operations = [
migrations.AlterField(
model_name='locationgroup',
name='color',
field=models.CharField(blank=True, max_length=32, null=True, verbose_name='background color'),
),
migrations.RunPython(convert_stuffed_area_to_location_group),
migrations.RemoveField(
model_name='area',

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-16 12:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mapdata', '0034_auto_20170807_1523'),
]
operations = [
migrations.AlterField(
model_name='locationgroup',
name='color',
field=models.CharField(blank=True, max_length=32, null=True, verbose_name='background color'),
),
]

View file

@ -183,7 +183,7 @@ class LocationGroup(Location, models.Model):
category = models.ForeignKey(LocationGroupCategory, related_name='groups', on_delete=models.PROTECT,
verbose_name=_('Category'))
priority = models.IntegerField(default=0, db_index=True)
color = models.CharField(null=True, blank=True, max_length=16, verbose_name=_('background color'))
color = models.CharField(null=True, blank=True, max_length=32, verbose_name=_('background color'))
objects = LocationGroupManager()