Add database initialization
This commit is contained in:
parent
b9d3326560
commit
5b377e5b19
4 changed files with 53 additions and 4 deletions
26
byro_schaffenburg/migrations/0001_initial.py
Normal file
26
byro_schaffenburg/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Generated by Django 2.0 on 2017-12-06 19:22
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
# ('members'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SchaffenProfile',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('membership_type', models.CharField(max_length=100)),
|
||||
('is_keyholder', models.BooleanField(default=False)),
|
||||
('has_physical_key', models.BooleanField(default=False)),
|
||||
('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='profile_schaffen', to='members.Member')),
|
||||
],
|
||||
),
|
||||
]
|
22
byro_schaffenburg/migrations/0002_auto_20180113_1330.py
Normal file
22
byro_schaffenburg/migrations/0002_auto_20180113_1330.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.8 on 2018-01-13 13:30
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import annoying.fields
|
||||
from django.db import migrations
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('byro_schaffenburg', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='schaffenprofile',
|
||||
name='member',
|
||||
field=annoying.fields.AutoOneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile_shack', to='members.Member'),
|
||||
),
|
||||
]
|
0
byro_schaffenburg/migrations/__init__.py
Normal file
0
byro_schaffenburg/migrations/__init__.py
Normal file
|
@ -1,5 +1,6 @@
|
|||
from annoying.fields import AutoOneToOneField
|
||||
from django.db import models
|
||||
from byro.common.models.choices import Choices
|
||||
|
||||
class MembershipTypes(Choices):
|
||||
FULL = "Vollmitglied"
|
||||
|
@ -9,19 +10,19 @@ class SchaffenProfile(models.Model):
|
|||
member = AutoOneToOneField(
|
||||
to='members.Member',
|
||||
on_delete=models.CASCADE,
|
||||
related_name='profile_schaffenburg',
|
||||
related_name='profile_schaffen',
|
||||
)
|
||||
membership_type = models.CharField(
|
||||
max_length=MembershipTypes.max_length,
|
||||
verbose_name=_("Art der Mitgliedschaft"),
|
||||
verbose_name=("Art der Mitgliedschaft"),
|
||||
choices=MembershipTypes.choices,
|
||||
default=MembershipTypes.FULL,
|
||||
)
|
||||
is_keyholder = models.BooleanField(
|
||||
default=False,
|
||||
verbose_name=_("Ist schließberechtigt"),
|
||||
verbose_name=("Ist schließberechtigt"),
|
||||
)
|
||||
has_physical_key = models.BooleanField(
|
||||
default=False,
|
||||
verbose_name=_("Besitzt physischen Schlüssel"),
|
||||
verbose_name=("Besitzt physischen Schlüssel"),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue