Fix verbose_name for fields, update migrations

This commit is contained in:
Paul Konstantin Gerke 2022-03-05 13:01:28 +01:00
parent f31dbaf15c
commit 7bbaee1f80
3 changed files with 38 additions and 77 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.0.3 on 2022-03-05 11:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('babybuddy', '0020_update_language_en_to_en_us'),
]
operations = [
migrations.AlterField(
model_name='settings',
name='language',
field=models.CharField(choices=[('zh-hans', 'Chinese (simplified)'), ('nl', 'Dutch'), ('en-US', 'English (US)'), ('en-GB', 'English (UK)'), ('fr', 'French'), ('fi', 'Finnish'), ('de', 'German'), ('it', 'Italian'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('es', 'Spanish'), ('sv', 'Swedish'), ('tr', 'Turkish')], default='en-US', max_length=255, verbose_name='Language'),
),
]

View File

@ -1,4 +1,4 @@
# Generated by Django 4.0.2 on 2022-03-02 20:48 # Generated by Django 4.0.3 on 2022-03-05 12:00
import core.models import core.models
import django.core.validators import django.core.validators
@ -10,96 +10,40 @@ import django.utils.timezone
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
("contenttypes", "0002_remove_content_type_name"), ('contenttypes', '0002_remove_content_type_name'),
("core", "0018_bmi_headcircumference_height"), ('core', '0018_bmi_headcircumference_height'),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name="Tag", name='Tag',
fields=[ fields=[
( ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
"id", ('name', models.CharField(max_length=100, unique=True, verbose_name='name')),
models.AutoField( ('slug', models.SlugField(max_length=100, unique=True, verbose_name='slug')),
auto_created=True, ('color', models.CharField(default=core.models.random_color, max_length=32, validators=[django.core.validators.RegexValidator('^#[0-9A-F]{6}$')], verbose_name='Color')),
primary_key=True, ('last_used', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Last used')),
serialize=False,
verbose_name="ID",
),
),
(
"name",
models.CharField(max_length=100, unique=True, verbose_name="name"),
),
(
"slug",
models.SlugField(max_length=100, unique=True, verbose_name="slug"),
),
(
"color",
models.CharField(
default=core.models.random_color,
max_length=32,
validators=[
django.core.validators.RegexValidator("^#[0-9A-F]{6}$")
],
verbose_name="Color",
),
),
("last_used", models.DateTimeField(default=django.utils.timezone.now)),
], ],
options={ options={
"verbose_name": "Tag", 'verbose_name': 'Tag',
"verbose_name_plural": "Tags", 'verbose_name_plural': 'Tags',
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
name="Tagged", name='Tagged',
fields=[ fields=[
( ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
"id", ('object_id', models.IntegerField(db_index=True, verbose_name='object ID')),
models.AutoField( ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_tagged_items', to='contenttypes.contenttype', verbose_name='content type')),
auto_created=True, ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_items', to='core.tag', verbose_name='Tag')),
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"object_id",
models.IntegerField(db_index=True, verbose_name="object ID"),
),
(
"content_type",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="%(app_label)s_%(class)s_tagged_items",
to="contenttypes.contenttype",
verbose_name="content type",
),
),
(
"tag",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="%(app_label)s_%(class)s_items",
to="core.tag",
),
),
], ],
options={ options={
"abstract": False, 'abstract': False,
}, },
), ),
migrations.AddField( migrations.AddField(
model_name="note", model_name='note',
name="tags", name='tags',
field=core.models.TaggableManager( field=core.models.TaggableManager(blank=True, help_text=None, through='core.Tagged', to='core.Tag', verbose_name='Tags'),
blank=True,
help_text=None,
through="core.Tagged",
to="core.Tag",
verbose_name="Tags",
),
), ),
] ]

View File

@ -110,7 +110,6 @@ class Tag(TagBase):
verbose_name_plural = _("Tags") verbose_name_plural = _("Tags")
color = models.CharField( color = models.CharField(
"Color",
verbose_name=_("Color"), verbose_name=_("Color"),
max_length=32, max_length=32,
default=random_color, default=random_color,