0015_coderedsessionformsubmission_coderedsubmissionrevision.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Generated by Django 2.2.1 on 2019-05-04 15:09
  2. from django.conf import settings
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. ('contenttypes', '0002_remove_content_type_name'),
  8. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  9. ('wagtailcore', '0041_group_collection_permissions_verbose_name_plural'),
  10. ('wagtailcrx', '0014_classifiers'),
  11. ]
  12. operations = [
  13. migrations.CreateModel(
  14. name='CoderedSubmissionRevision',
  15. fields=[
  16. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  17. ('type', models.CharField(choices=[('created', 'Created'), ('changed', 'Changed'), ('deleted', 'Deleted')], max_length=7)),
  18. ('created_at', models.DateTimeField(auto_now_add=True)),
  19. ('submission_id', models.TextField()),
  20. ('data', models.TextField()),
  21. ('summary', models.TextField()),
  22. ('submission_ct', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
  23. ],
  24. options={
  25. 'ordering': ('-created_at',),
  26. 'abstract': False,
  27. },
  28. ),
  29. migrations.CreateModel(
  30. name='CoderedSessionFormSubmission',
  31. fields=[
  32. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  33. ('form_data', models.TextField()),
  34. ('submit_time', models.DateTimeField(auto_now_add=True, verbose_name='submit time')),
  35. ('session_key', models.CharField(default=None, max_length=40, null=True)),
  36. ('thumbnails_by_path', models.TextField(default='{}')),
  37. ('last_modification', models.DateTimeField(auto_now=True, verbose_name='last modification')),
  38. ('status', models.CharField(choices=[('incomplete', 'Not submitted'), ('complete', 'Complete'), ('reviewed', 'Under consideration'), ('approved', 'Approved'), ('rejected', 'Rejected')], default='incomplete', max_length=10)),
  39. ('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wagtailcore.Page')),
  40. ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL)),
  41. ],
  42. options={
  43. 'verbose_name': 'form submission',
  44. 'unique_together': {('page', 'session_key'), ('page', 'user')},
  45. 'abstract': False,
  46. 'verbose_name_plural': 'form submissions',
  47. },
  48. ),
  49. ]