0001_initial.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Generated by Django 4.0.4 on 2022-04-18 12:32
  2. import colorfield.fields
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. ]
  9. operations = [
  10. migrations.CreateModel(
  11. name='Group',
  12. fields=[
  13. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  14. ('name', models.CharField(max_length=255)),
  15. ('color', colorfield.fields.ColorField(default='#fb35e8', image_field=None, max_length=18, samples=None)),
  16. ],
  17. ),
  18. migrations.CreateModel(
  19. name='Person',
  20. fields=[
  21. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  22. ('name', models.CharField(max_length=255)),
  23. ('birth_date', models.DateField(blank=True, null=True)),
  24. ('birth_town', models.CharField(blank=True, max_length=255, null=True)),
  25. ('death_date', models.DateField(blank=True, null=True)),
  26. ('death_town', models.CharField(blank=True, max_length=255, null=True)),
  27. ('comment', models.TextField(blank=True, null=True)),
  28. ('image', models.ImageField(blank=True, null=True, upload_to='stammbaum/images')),
  29. ('group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='stammbaum.group')),
  30. ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='parent_map', to='stammbaum.person')),
  31. ],
  32. options={
  33. 'permissions': [('view', 'Can view Stammbaum'), ('upload_image', 'Can upload images')],
  34. },
  35. ),
  36. migrations.CreateModel(
  37. name='Pair',
  38. fields=[
  39. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  40. ('color', colorfield.fields.ColorField(default='#c37768', image_field=None, max_length=18, samples=None)),
  41. ('person1', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='person1', to='stammbaum.person')),
  42. ('person2', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='person2', to='stammbaum.person')),
  43. ],
  44. ),
  45. ]