0001_initial.py 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import models, migrations
  4. import mezzanine.core.fields
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. ('pages', '__first__'),
  8. ]
  9. operations = [
  10. migrations.CreateModel(
  11. name='Field',
  12. fields=[
  13. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  14. ('_order', models.IntegerField(null=True, verbose_name='Order')),
  15. ('label', models.CharField(max_length=200, verbose_name='Label')),
  16. ('field_type', models.IntegerField(verbose_name='Type', choices=[(1, 'Single line text'), (2, 'Multi line text'), (3, 'Email'), (13, 'Number'), (14, 'URL'), (4, 'Check box'), (5, 'Check boxes'), (6, 'Drop down'), (7, 'Multi select'), (8, 'Radio buttons'), (9, 'File upload'), (10, 'Date'), (11, 'Date/time'), (15, 'Date of birth'), (12, 'Hidden')])),
  17. ('required', models.BooleanField(default=True, verbose_name='Required')),
  18. ('visible', models.BooleanField(default=True, verbose_name='Visible')),
  19. ('choices', models.CharField(help_text='Comma separated options where applicable. If an option itself contains commas, surround the option with `backticks`.', max_length=1000, verbose_name='Choices', blank=True)),
  20. ('default', models.CharField(max_length=2000, verbose_name='Default value', blank=True)),
  21. ('placeholder_text', models.CharField(verbose_name='Placeholder Text', max_length=100, editable=False, blank=True)),
  22. ('help_text', models.CharField(max_length=100, verbose_name='Help text', blank=True)),
  23. ],
  24. options={
  25. 'ordering': ('_order',),
  26. 'verbose_name': 'Field',
  27. 'verbose_name_plural': 'Fields',
  28. },
  29. bases=(models.Model,),
  30. ),
  31. migrations.CreateModel(
  32. name='FieldEntry',
  33. fields=[
  34. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  35. ('field_id', models.IntegerField()),
  36. ('value', models.CharField(max_length=2000, null=True)),
  37. ],
  38. options={
  39. 'verbose_name': 'Form field entry',
  40. 'verbose_name_plural': 'Form field entries',
  41. },
  42. bases=(models.Model,),
  43. ),
  44. migrations.CreateModel(
  45. name='Form',
  46. fields=[
  47. ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='pages.Page')),
  48. ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
  49. ('button_text', models.CharField(default='Submit', max_length=50, verbose_name='Button text')),
  50. ('response', mezzanine.core.fields.RichTextField(verbose_name='Response')),
  51. ('send_email', models.BooleanField(default=True, help_text='To send an email to the email address supplied in the form upon submission, check this box.', verbose_name='Send email to user')),
  52. ('email_from', models.EmailField(help_text='The address the email will be sent from', max_length=75, verbose_name='From address', blank=True)),
  53. ('email_copies', models.CharField(help_text='Provide a comma separated list of email addresses to be notified upon form submission. Leave blank to disable notifications.', max_length=200, verbose_name='Send email to others', blank=True)),
  54. ('email_subject', models.CharField(max_length=200, verbose_name='Subject', blank=True)),
  55. ('email_message', models.TextField(help_text='Emails sent based on the above options will contain each of the form fields entered. You can also enter a message here that will be included in the email.', verbose_name='Message', blank=True)),
  56. ],
  57. options={
  58. 'ordering': ('_order',),
  59. 'verbose_name': 'Form',
  60. 'verbose_name_plural': 'Forms',
  61. },
  62. bases=('pages.page', models.Model),
  63. ),
  64. migrations.CreateModel(
  65. name='FormEntry',
  66. fields=[
  67. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  68. ('entry_time', models.DateTimeField(verbose_name='Date/time')),
  69. ('form', models.ForeignKey(related_name='entries', to='forms.Form')),
  70. ],
  71. options={
  72. 'verbose_name': 'Form entry',
  73. 'verbose_name_plural': 'Form entries',
  74. },
  75. bases=(models.Model,),
  76. ),
  77. migrations.AddField(
  78. model_name='fieldentry',
  79. name='entry',
  80. field=models.ForeignKey(related_name='fields', to='forms.FormEntry'),
  81. preserve_default=True,
  82. ),
  83. migrations.AddField(
  84. model_name='field',
  85. name='form',
  86. field=models.ForeignKey(related_name='fields', to='forms.Form'),
  87. preserve_default=True,
  88. ),
  89. ]