update
[prawokultury.git] / questions / migrations / 0001_initial.py
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3
4 from django.db import models, migrations
5 import django.db.models.deletion
6 import taggit_autosuggest.managers
7 import markupfield.fields
8
9
10 class Migration(migrations.Migration):
11
12     dependencies = [
13         ('contenttypes', '0001_initial'),
14     ]
15
16     operations = [
17         migrations.CreateModel(
18             name='Question',
19             fields=[
20                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
21                 ('email', models.EmailField(max_length=75, null=True, verbose_name='contact e-mail', blank=True)),
22                 ('question', models.TextField(verbose_name='question')),
23                 ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
24                 ('changed_at', models.DateTimeField(auto_now=True, verbose_name='changed at')),
25                 ('approved', models.BooleanField(default=False, verbose_name='approved')),
26                 ('edited_question', models.TextField(help_text="Leave empty if question doesn't need editing.", null=True, verbose_name='edited question', blank=True)),
27                 ('answer', markupfield.fields.MarkupField(help_text='Use <a href="http://txstyle.org/">Textile</a> syntax.', rendered_field=True, verbose_name='answer', blank=True)),
28                 ('answered_by', models.CharField(max_length=127, null=True, verbose_name='answered by', blank=True)),
29                 ('answer_markup_type', models.CharField(default=b'textile_pl', max_length=30, editable=False, choices=[(b'', b'--'), (b'textile_pl', b'textile_pl')])),
30                 ('answered', models.BooleanField(default=False, help_text='Check to send the answer to user.', db_index=True, verbose_name='answered')),
31                 ('_answer_rendered', models.TextField(editable=False)),
32                 ('answered_at', models.DateTimeField(db_index=True, null=True, verbose_name='answered at', blank=True)),
33                 ('published', models.BooleanField(default=False, help_text='Check to display answered question on site.', db_index=True, verbose_name='published')),
34                 ('published_at', models.DateTimeField(db_index=True, null=True, verbose_name='published at', blank=True)),
35             ],
36             options={
37                 'ordering': ['-created_at'],
38                 'verbose_name': 'question',
39                 'verbose_name_plural': 'questions',
40             },
41             bases=(models.Model,),
42         ),
43         migrations.CreateModel(
44             name='Tag',
45             fields=[
46                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
47                 ('name', models.CharField(unique=True, max_length=100, verbose_name='Name')),
48                 ('slug', models.SlugField(unique=True, max_length=100, verbose_name='Slug')),
49                 ('click_count', models.IntegerField(default=0)),
50             ],
51             options={
52                 'verbose_name': 'Tag',
53                 'verbose_name_plural': 'Tags',
54             },
55             bases=(models.Model,),
56         ),
57         migrations.CreateModel(
58             name='TagCategory',
59             fields=[
60                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
61                 ('name', models.CharField(unique=True, max_length=100, verbose_name='Name')),
62                 ('slug', models.SlugField(unique=True, max_length=100, verbose_name='Slug')),
63             ],
64             options={
65                 'verbose_name': 'Tag Category',
66                 'verbose_name_plural': 'Tag Categories',
67             },
68             bases=(models.Model,),
69         ),
70         migrations.CreateModel(
71             name='TagItem',
72             fields=[
73                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
74                 ('object_id', models.IntegerField(verbose_name='Object id', db_index=True)),
75                 ('content_type', models.ForeignKey(related_name='questions_tagitem_tagged_items', on_delete=models.CASCADE, verbose_name='Content type', to='contenttypes.ContentType')),
76                 ('tag', models.ForeignKey(related_name='items', to='questions.Tag', on_delete=models.CASCADE)),
77             ],
78             options={
79                 'abstract': False,
80             },
81             bases=(models.Model,),
82         ),
83         migrations.AddField(
84             model_name='tag',
85             name='category',
86             field=models.ForeignKey(related_name='tags', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='questions.TagCategory', null=True),
87             preserve_default=True,
88         ),
89         migrations.AddField(
90             model_name='question',
91             name='tags',
92             field=taggit_autosuggest.managers.TaggableManager(to='questions.Tag', through='questions.TagItem', blank=True, help_text='A comma-separated list of tags.', verbose_name='Tags'),
93             preserve_default=True,
94         ),
95     ]