Cite base
[wolnelektury.git] / src / contact / migrations / 0001_initial.py
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3
4 from django.db import migrations, models
5 import jsonfield.fields
6
7
8 class Migration(migrations.Migration):
9
10     dependencies = [
11     ]
12
13     operations = [
14         migrations.CreateModel(
15             name='Attachment',
16             fields=[
17                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
18                 ('tag', models.CharField(max_length=64)),
19                 ('file', models.FileField(upload_to='contact/attachment')),
20             ],
21         ),
22         migrations.CreateModel(
23             name='Contact',
24             fields=[
25                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
26                 ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='submission date')),
27                 ('ip', models.GenericIPAddressField(verbose_name='IP address')),
28                 ('contact', models.EmailField(max_length=128, verbose_name='contact')),
29                 ('form_tag', models.CharField(max_length=32, verbose_name='form', db_index=True)),
30                 ('body', jsonfield.fields.JSONField(verbose_name='body')),
31             ],
32             options={
33                 'ordering': ('-created_at',),
34                 'verbose_name': 'submitted form',
35                 'verbose_name_plural': 'submitted forms',
36             },
37         ),
38         migrations.AddField(
39             model_name='attachment',
40             name='contact',
41             field=models.ForeignKey(to='contact.Contact'),
42         ),
43     ]