This is emberassing; forgot verbose_name

New migrations require total wipe of database.
Expect a couple of migration complete reboots during initial dev.
This commit is contained in:
Christoffer Viken 2015-08-16 21:44:15 +02:00
parent e66db0b857
commit aed126f8f0
7 changed files with 131 additions and 282 deletions

View File

@ -6,45 +6,61 @@ from django.conf import settings
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('waffles', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL), migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('waffles', '0002_auto_20150816_1357'),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='Calculation', name='Calculation',
fields=[ fields=[
('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
('date', models.DateTimeField()), ('amount', models.IntegerField(verbose_name='Amount owed')),
('date', models.DateTimeField(verbose_name='Date integrated')),
], ],
options={
'verbose_name': 'Calculation',
'verbose_name_plural': 'Calculations',
},
), ),
migrations.CreateModel( migrations.CreateModel(
name='Debt', name='Debt',
fields=[ fields=[
('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
('amount', models.BigIntegerField()), ('amount', models.BigIntegerField(verbose_name='Amount owed')),
('debtee', models.ForeignKey(related_name='debtee', to=settings.AUTH_USER_MODEL)), (
('debtor', models.ForeignKey(related_name='debtor', to=settings.AUTH_USER_MODEL)), 'debtee', models.ForeignKey(verbose_name='Debtee', related_name='debtee', to=settings.AUTH_USER_MODEL)),
(
'debtor', models.ForeignKey(verbose_name='Debtor', related_name='debtor', to=settings.AUTH_USER_MODEL)),
], ],
options={
'verbose_name': 'Total debt',
'verbose_name_plural': 'Total debts',
},
), ),
migrations.CreateModel( migrations.CreateModel(
name='Settlement', name='Settlement',
fields=[ fields=[
('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
('dato', models.DateField()), ('date', models.DateField(verbose_name='Date made')),
('amount', models.IntegerField()), ('amount', models.IntegerField(verbose_name='Amount owed')),
('debt', models.ForeignKey(to='mercantile.Debt')), ('debt', models.ForeignKey(verbose_name='Connected debt', to='mercantile.Debt')),
], ],
options={
'verbose_name': 'Cash settlement',
'verbose_name_plural': 'Cash settlements',
},
), ),
migrations.AddField( migrations.AddField(
model_name='calculation', model_name='calculation',
name='debt', name='debt',
field=models.ForeignKey(to='mercantile.Debt'), field=models.ForeignKey(verbose_name='Connected debt', to='mercantile.Debt'),
), ),
migrations.AddField( migrations.AddField(
model_name='calculation', model_name='calculation',
name='event', name='event',
field=models.ForeignKey(to='waffles.Event'), field=models.ForeignKey(to_field='Connected event', to='waffles.Event'),
), ),
] ]

View File

@ -24,7 +24,7 @@ msgstr "Brukerprofil"
#: models.py:14 #: models.py:14
msgid "User profiles" msgid "User profiles"
msgstr "Bruerprofiler" msgstr "Brukerprofiler"
#: models.py:24 #: models.py:24
msgid "Community name" msgid "Community name"

View File

@ -2,13 +2,14 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import django.core.validators
import django.utils.timezone
import django.contrib.auth.models import django.contrib.auth.models
import django.utils.timezone
import django.core.validators
from django.conf import settings from django.conf import settings
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('auth', '0006_require_contenttypes_0002'), ('auth', '0006_require_contenttypes_0002'),
] ]
@ -17,37 +18,40 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='UserProfile', name='UserProfile',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('password', models.CharField(verbose_name='password', max_length=128)), ('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(null=True, verbose_name='last login', blank=True)), ('last_login', models.DateTimeField(blank=True, verbose_name='last login', null=True)),
('is_superuser', models.BooleanField(verbose_name='superuser status', default=False, ('is_superuser', models.BooleanField(default=False,
help_text='Designates that this user has all permissions without explicitly assigning them.')), help_text='Designates that this user has all permissions without explicitly assigning them.',
('username', models.CharField(verbose_name='username', unique=True, validators=[ verbose_name='superuser status')),
('username', models.CharField(max_length=30, verbose_name='username', validators=[
django.core.validators.RegexValidator('^[\\w.@+-]+$', django.core.validators.RegexValidator('^[\\w.@+-]+$',
'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.',
'invalid')], max_length=30, 'invalid')], unique=True,
help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.',
error_messages={'unique': 'A user with that username already exists.'})), error_messages={'unique': 'A user with that username already exists.'})),
('first_name', models.CharField(verbose_name='first name', blank=True, max_length=30)), ('first_name', models.CharField(max_length=30, blank=True, verbose_name='first name')),
('last_name', models.CharField(verbose_name='last name', blank=True, max_length=30)), ('last_name', models.CharField(max_length=30, blank=True, verbose_name='last name')),
('email', models.EmailField(verbose_name='email address', blank=True, max_length=254)), ('email', models.EmailField(max_length=254, blank=True, verbose_name='email address')),
('is_staff', models.BooleanField(verbose_name='staff status', default=False, ('is_staff', models.BooleanField(default=False,
help_text='Designates whether the user can log into this admin site.')), help_text='Designates whether the user can log into this admin site.',
('is_active', models.BooleanField(verbose_name='active', default=True, verbose_name='staff status')),
help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.')), ('is_active', models.BooleanField(default=True,
('date_joined', models.DateTimeField(verbose_name='date joined', default=django.utils.timezone.now)), help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
('groups', models.ManyToManyField(verbose_name='groups', to='auth.Group', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('groups',
models.ManyToManyField(related_query_name='user', verbose_name='groups', related_name='user_set',
help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.',
related_query_name='user', blank=True, related_name='user_set')), blank=True, to='auth.Group')),
('user_permissions', models.ManyToManyField(verbose_name='user permissions', to='auth.Permission', ('user_permissions', models.ManyToManyField(related_query_name='user', verbose_name='user permissions',
help_text='Specific permissions for this user.', related_name='user_set',
related_query_name='user', blank=True, help_text='Specific permissions for this user.', blank=True,
related_name='user_set')), to='auth.Permission')),
], ],
options={ options={
'verbose_name': 'user', 'verbose_name_plural': 'User profiles',
'verbose_name_plural': 'users', 'verbose_name': 'User profile',
'abstract': False,
}, },
managers=[ managers=[
('objects', django.contrib.auth.models.UserManager()), ('objects', django.contrib.auth.models.UserManager()),
@ -56,17 +60,76 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Community', name='Community',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('name', models.CharField(max_length=64)), ('name', models.CharField(max_length=64, verbose_name='Community name')),
('members', models.ManyToManyField(to=settings.AUTH_USER_MODEL)), ('members', models.ManyToManyField(verbose_name='Community members', to=settings.AUTH_USER_MODEL)),
], ],
options={
'verbose_name_plural': 'Communities',
'verbose_name': 'Community',
},
), ),
migrations.CreateModel( migrations.CreateModel(
name='Event', name='Event',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('name', models.CharField(max_length=64)), ('name', models.CharField(max_length=64, verbose_name='Event name')),
('description', models.TextField()), ('description', models.TextField(verbose_name='Description/text')),
('open', models.BooleanField(verbose_name='Open for new participants')),
('status', models.BooleanField(verbose_name='Finalized')),
('timeFrom', models.DateTimeField(verbose_name='Start time')),
('timeTo', models.DateTimeField(verbose_name='End time')),
('participants', models.ManyToManyField(verbose_name='Participants', to=settings.AUTH_USER_MODEL)),
], ],
options={
'verbose_name_plural': 'Events',
'verbose_name': 'Event',
},
),
migrations.CreateModel(
name='Listing',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('timeFrom', models.DateTimeField(verbose_name='Start time')),
('timeTo', models.DateTimeField(verbose_name='End time')),
('description', models.TextField(verbose_name='Description/text')),
('community', models.ForeignKey(verbose_name='Community', to='waffles.Community')),
('user', models.ForeignKey(verbose_name='Requesting user', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name_plural': 'Listing',
'verbose_name': 'Listing',
},
),
migrations.CreateModel(
name='ShoppingList',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('name', models.CharField(max_length=64, verbose_name='Name')),
('price', models.IntegerField(verbose_name='Price')),
('payers', models.ManyToManyField(verbose_name='Payers', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name_plural': 'Shopping lists',
'verbose_name': 'Shopping list',
},
),
migrations.CreateModel(
name='SubEvent',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('name', models.CharField(max_length=64, verbose_name='Name')),
('event', models.ForeignKey(verbose_name='Parent event', to='waffles.Event')),
('participants', models.ManyToManyField(verbose_name='Participants', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name_plural': 'Sub Events',
'verbose_name': 'Sub Event',
},
),
migrations.AddField(
model_name='shoppinglist',
name='subevent',
field=models.ForeignKey(verbose_name='Connected sub-event', to='waffles.SubEvent'),
), ),
] ]

View File

@ -1,82 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import models, migrations
from django.utils.timezone import utc
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('waffles', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Listing',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('timeFrom', models.DateTimeField()),
('timeTo', models.DateTimeField()),
('description', models.TextField()),
('community', models.ForeignKey(to='waffles.Community')),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='ShoppingList',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=64)),
('price', models.IntegerField()),
('payers', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Subevent',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=64)),
],
),
migrations.AddField(
model_name='event',
name='participants',
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='event',
name='status',
field=models.BooleanField(default=datetime.datetime(2015, 8, 16, 13, 56, 47, 395852, tzinfo=utc)),
preserve_default=False,
),
migrations.AddField(
model_name='event',
name='timeFrom',
field=models.DateTimeField(default=datetime.datetime(2015, 8, 16, 13, 56, 56, 586943, tzinfo=utc)),
preserve_default=False,
),
migrations.AddField(
model_name='event',
name='timeTo',
field=models.DateTimeField(default=datetime.datetime(2015, 8, 16, 13, 57, 0, 178924, tzinfo=utc)),
preserve_default=False,
),
migrations.AddField(
model_name='subevent',
name='event',
field=models.ForeignKey(to='waffles.Event'),
),
migrations.AddField(
model_name='subevent',
name='participants',
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='shoppinglist',
name='subevent',
field=models.ForeignKey(to='waffles.Subevent'),
),
]

View File

@ -1,148 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import models, migrations
from django.utils.timezone import utc
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('waffles', '0002_auto_20150816_1357'),
]
operations = [
migrations.AlterModelOptions(
name='community',
options={'verbose_name': 'Community', 'verbose_name_plural': 'Communities'},
),
migrations.AlterModelOptions(
name='event',
options={'verbose_name': 'Event', 'verbose_name_plural': 'Events'},
),
migrations.AlterModelOptions(
name='listing',
options={'verbose_name': 'Listing', 'verbose_name_plural': 'Listing'},
),
migrations.AlterModelOptions(
name='shoppinglist',
options={'verbose_name': 'Shopping list', 'verbose_name_plural': 'Shopping lists'},
),
migrations.AlterModelOptions(
name='subevent',
options={'verbose_name': 'Sub Event', 'verbose_name_plural': 'Sub Events'},
),
migrations.AlterModelOptions(
name='userprofile',
options={'verbose_name': 'User profile', 'verbose_name_plural': 'User profiles'},
),
migrations.AddField(
model_name='event',
name='open',
field=models.BooleanField(default=datetime.datetime(2015, 8, 16, 19, 9, 38, 507600, tzinfo=utc),
verbose_name='Open for new participants'),
preserve_default=False,
),
migrations.AlterField(
model_name='community',
name='members',
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, db_constraint='Community members'),
),
migrations.AlterField(
model_name='community',
name='name',
field=models.CharField(verbose_name='Community name', max_length=64),
),
migrations.AlterField(
model_name='event',
name='description',
field=models.TextField(verbose_name='Description/text'),
),
migrations.AlterField(
model_name='event',
name='name',
field=models.CharField(verbose_name='Event name', max_length=64),
),
migrations.AlterField(
model_name='event',
name='participants',
field=models.ManyToManyField(verbose_name='Participants', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='event',
name='status',
field=models.BooleanField(verbose_name='Finalized'),
),
migrations.AlterField(
model_name='event',
name='timeFrom',
field=models.DateTimeField(verbose_name='Start time'),
),
migrations.AlterField(
model_name='event',
name='timeTo',
field=models.DateTimeField(verbose_name='End time'),
),
migrations.AlterField(
model_name='listing',
name='community',
field=models.ForeignKey(to='waffles.Community', verbose_name='Community'),
),
migrations.AlterField(
model_name='listing',
name='description',
field=models.TextField(verbose_name='Description/text'),
),
migrations.AlterField(
model_name='listing',
name='timeFrom',
field=models.DateTimeField(verbose_name='Start time'),
),
migrations.AlterField(
model_name='listing',
name='timeTo',
field=models.DateTimeField(verbose_name='End time'),
),
migrations.AlterField(
model_name='listing',
name='user',
field=models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Requesting user'),
),
migrations.AlterField(
model_name='shoppinglist',
name='name',
field=models.CharField(verbose_name='Name', max_length=64),
),
migrations.AlterField(
model_name='shoppinglist',
name='payers',
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, db_constraint='Payers'),
),
migrations.AlterField(
model_name='shoppinglist',
name='price',
field=models.IntegerField(verbose_name='Price'),
),
migrations.AlterField(
model_name='shoppinglist',
name='subevent',
field=models.ForeignKey(to='waffles.SubEvent', to_field='Connected sub-event'),
),
migrations.AlterField(
model_name='subevent',
name='event',
field=models.ForeignKey(to='waffles.Event', to_field='Parent event'),
),
migrations.AlterField(
model_name='subevent',
name='name',
field=models.CharField(verbose_name='Name', max_length=64),
),
migrations.AlterField(
model_name='subevent',
name='participants',
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, db_constraint='Participants'),
),
]

View File

@ -22,7 +22,7 @@ class Community(models.Model):
grow more complex over time. grow more complex over time.
""" """
name = models.CharField(max_length=64, verbose_name=_("Community name")) name = models.CharField(max_length=64, verbose_name=_("Community name"))
members = models.ManyToManyField(UserProfile, _("Community members")) members = models.ManyToManyField(UserProfile, verbose_name=_("Community members"))
class Meta: class Meta:
verbose_name = _('Community') verbose_name = _('Community')
@ -72,8 +72,8 @@ class SubEvent(models.Model):
Used when not everyone is participating in the entire event. Used when not everyone is participating in the entire event.
""" """
name = models.CharField(max_length=64, verbose_name=_("Name")) name = models.CharField(max_length=64, verbose_name=_("Name"))
participants = models.ManyToManyField(UserProfile, _("Participants")) participants = models.ManyToManyField(UserProfile, verbose_name=_("Participants"))
event = models.ForeignKey(Event, _("Parent event")) event = models.ForeignKey(Event, verbose_name=_("Parent event"))
class Meta: class Meta:
verbose_name = _('Sub Event') verbose_name = _('Sub Event')
@ -88,8 +88,8 @@ class ShoppingList(models.Model):
""" """
name = models.CharField(max_length=64, verbose_name=_("Name")) name = models.CharField(max_length=64, verbose_name=_("Name"))
price = models.IntegerField(verbose_name=_("Price")) price = models.IntegerField(verbose_name=_("Price"))
payers = models.ManyToManyField(UserProfile, _("Payers")) payers = models.ManyToManyField(UserProfile, verbose_name=_("Payers"))
subevent = models.ForeignKey(SubEvent, _("Connected sub-event")) subevent = models.ForeignKey(SubEvent, verbose_name=_("Connected sub-event"))
class Meta: class Meta:
verbose_name = _('Shopping list') verbose_name = _('Shopping list')