Skip to content

Commit

Permalink
Use dynamic choices in migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
bhrutledge committed Nov 17, 2016
1 parent 86c5b79 commit 00fa6e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,8 +1,10 @@
*.pyc
*.egg-info
.DS_Store
.coverage
.idea/
.tox/
.eggs/
dist/
build/
htmlcov/
3 changes: 2 additions & 1 deletion djangocms_style/migrations/0003_adapted_fields.py
Expand Up @@ -4,6 +4,7 @@
from django.db import migrations, models

import djangocms_attributes_field.fields
from djangocms_style.models import TAG_CHOICES


class Migration(migrations.Migration):
Expand Down Expand Up @@ -76,6 +77,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='style',
name='tag_type',
field=models.CharField(default='div', max_length=255, verbose_name='Tag type', choices=[('div', 'div'), ('article', 'article'), ('section', 'section'), ('header', 'header'), ('footer', 'footer'), ('aside', 'aside'), ('h1', 'h1'), ('h2', 'h2'), ('h3', 'h3'), ('h4', 'h4'), ('h5', 'h5'), ('h6', 'h6')]),
field=models.CharField(max_length=255, verbose_name='Tag type', choices=TAG_CHOICES, default=TAG_CHOICES[0][0])
),
]
4 changes: 2 additions & 2 deletions djangocms_style/migrations/0006_removed_null_fields.py
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals

from django.db import migrations, models

from djangocms_style.models import CLASS_CHOICES

class Migration(migrations.Migration):

Expand All @@ -14,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='style',
name='class_name',
field=models.CharField(default='container', max_length=255, verbose_name='Class name', blank=True, choices=[('container', 'container'), ('content', 'content'), ('teaser', 'teaser')]),
field=models.CharField(max_length=255, verbose_name='Class name', blank=True, choices=CLASS_CHOICES, default=CLASS_CHOICES[0][0])
),
]
3 changes: 2 additions & 1 deletion djangocms_style/migrations/0007_style_template.py
Expand Up @@ -2,6 +2,7 @@
from __future__ import unicode_literals

from django.db import migrations, models
from djangocms_style.models import get_templates


class Migration(migrations.Migration):
Expand All @@ -14,6 +15,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='style',
name='template',
field=models.CharField(default='default', max_length=255, verbose_name='Template', choices=[('default', 'Default')]),
field=models.CharField(max_length=255, verbose_name='Template', choices=get_templates(), default=get_templates()[0][0])
),
]

0 comments on commit 00fa6e5

Please sign in to comment.