diff --git a/backend/case_study/migrations/0001_initial.py b/backend/case_study/migrations/0001_initial.py new file mode 100644 index 00000000..b786c27b --- /dev/null +++ b/backend/case_study/migrations/0001_initial.py @@ -0,0 +1,25 @@ +# Generated by Django 4.2.7 on 2024-01-31 16:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='CaseStudy', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256)), + ], + options={ + 'verbose_name': 'case study', + 'verbose_name_plural': 'case studies', + }, + ), + ] diff --git a/backend/event/migrations/0001_initial.py b/backend/event/migrations/0001_initial.py new file mode 100644 index 00000000..1c1039c2 --- /dev/null +++ b/backend/event/migrations/0001_initial.py @@ -0,0 +1,97 @@ +# Generated by Django 4.2.7 on 2024-01-31 16:20 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('person', '0001_initial'), + ('letter', '0001_initial'), + ('case_study', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='EpistolaryEvent', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256)), + ('note', models.TextField(blank=True, help_text='Additional notes that describe the event and what connects the letter actions it comprises.')), + ('case_studies', models.ManyToManyField(help_text='case studies this event belongs to', related_name='epistolary_events', to='case_study.casestudy')), + ], + ), + migrations.CreateModel( + name='LetterAction', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + ), + migrations.CreateModel( + name='Role', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('certainty', models.IntegerField(choices=[(0, 'uncertain'), (1, 'somewhat certain'), (2, 'certain')], default=2, help_text='How certain are you of this value?')), + ('note', models.TextField(blank=True, help_text='Additional notes')), + ('present', models.BooleanField(default=True, help_text='Whether this person was physically present')), + ('role', models.CharField(choices=[('author', 'Author'), ('scribe', 'Scribe'), ('reader', 'Reader'), ('witness', 'Witness'), ('messenger', 'Messenger'), ('recipient', 'Recipient'), ('intended_recipient', 'Intended recipient'), ('audience', 'Audience'), ('intended_audience', 'Intended audience'), ('other', 'Other')], help_text='Role of this person in the event')), + ('description', models.TextField(blank=True, help_text="Longer description of this person's involvement")), + ('letter_action', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='event.letteraction')), + ('person', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='person.person')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='LetterEventDate', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('certainty', models.IntegerField(choices=[(0, 'uncertain'), (1, 'somewhat certain'), (2, 'certain')], default=2, help_text='How certain are you of this value?')), + ('note', models.TextField(blank=True, help_text='Additional notes')), + ('year_lower', models.IntegerField(default=400, help_text='The earliest possible year for the letter action', validators=[django.core.validators.MinValueValidator(400), django.core.validators.MaxValueValidator(800)])), + ('year_upper', models.IntegerField(default=800, help_text='The latest possible year for the letter action', validators=[django.core.validators.MinValueValidator(400), django.core.validators.MaxValueValidator(800)])), + ('year_exact', models.IntegerField(blank=True, help_text='The exact year of the letter action (if known)', null=True, validators=[django.core.validators.MinValueValidator(400), django.core.validators.MaxValueValidator(800)])), + ('letter_action', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='date', to='event.letteraction')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='LetterActionCategory', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('certainty', models.IntegerField(choices=[(0, 'uncertain'), (1, 'somewhat certain'), (2, 'certain')], default=2, help_text='How certain are you of this value?')), + ('note', models.TextField(blank=True, help_text='Additional notes')), + ('value', models.CharField(choices=[('write', 'writing'), ('transport', 'transporting'), ('deliver', 'delivering'), ('read', 'reading'), ('sign', 'signing'), ('eat', 'eating')], help_text='The type of event')), + ('letter_action', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='categories', to='event.letteraction')), + ], + options={ + 'verbose_name_plural': 'letter action categories', + }, + ), + migrations.AddField( + model_name='letteraction', + name='actors', + field=models.ManyToManyField(related_name='events', through='event.Role', to='person.person'), + ), + migrations.AddField( + model_name='letteraction', + name='epistolary_events', + field=models.ManyToManyField(help_text='epistolary events this letter action belongs to', related_name='letter_actions', to='event.epistolaryevent'), + ), + migrations.AddField( + model_name='letteraction', + name='letters', + field=models.ManyToManyField(help_text='letters involved in this event', related_name='events', to='letter.letter'), + ), + migrations.AddConstraint( + model_name='letteractioncategory', + constraint=models.UniqueConstraint(models.F('value'), models.F('letter_action'), name='unique_categories_for_letter_action'), + ), + ] diff --git a/backend/letter/migrations/0001_initial.py b/backend/letter/migrations/0001_initial.py new file mode 100644 index 00000000..e8927350 --- /dev/null +++ b/backend/letter/migrations/0001_initial.py @@ -0,0 +1,34 @@ +# Generated by Django 4.2.7 on 2024-01-31 16:20 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Letter', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + ), + migrations.CreateModel( + name='LetterMaterial', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('certainty', models.IntegerField(choices=[(0, 'uncertain'), (1, 'somewhat certain'), (2, 'certain')], default=2, help_text='How certain are you of this value?')), + ('note', models.TextField(blank=True, help_text='Additional notes')), + ('surface', models.CharField(choices=[('parchment', 'parchment'), ('papyrus', 'papyrus'), ('other', 'other'), ('unknown', 'unknown')])), + ('letter', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='letter.letter')), + ], + options={ + 'abstract': False, + }, + ), + ] diff --git a/backend/lettercraft/settings.py b/backend/lettercraft/settings.py index 73af27b0..06748dcc 100644 --- a/backend/lettercraft/settings.py +++ b/backend/lettercraft/settings.py @@ -38,7 +38,12 @@ 'django.contrib.staticfiles', 'rest_framework', 'revproxy', - 'data', + 'core', + 'case_study', + 'event', + 'example', + 'letter', + 'person', ] MIDDLEWARE = [ diff --git a/backend/person/migrations/0001_initial.py b/backend/person/migrations/0001_initial.py new file mode 100644 index 00000000..81fce5c4 --- /dev/null +++ b/backend/person/migrations/0001_initial.py @@ -0,0 +1,34 @@ +# Generated by Django 4.2.7 on 2024-01-31 16:20 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Person', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + ), + migrations.CreateModel( + name='PersonName', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('certainty', models.IntegerField(choices=[(0, 'uncertain'), (1, 'somewhat certain'), (2, 'certain')], default=2, help_text='How certain are you of this value?')), + ('note', models.TextField(blank=True, help_text='Additional notes')), + ('value', models.CharField(blank=True, max_length=256)), + ('person', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='names', to='person.person', unique=True)), + ], + options={ + 'abstract': False, + }, + ), + ]