]> gitweb.fperrin.net Git - djsite.git/blob - quotes/migrations/0001_initial.py
Better implement tags, with separate namespaces
[djsite.git] / quotes / migrations / 0001_initial.py
1 # -*- coding: utf-8 -*-
2 # Generated by Django 1.10.2 on 2016-10-31 23:03
3 from __future__ import unicode_literals
4
5 from django.db import migrations, models
6 import django.db.models.deletion
7 import quotes.localmodels
8
9
10 class Migration(migrations.Migration):
11
12     initial = True
13
14     dependencies = [
15     ]
16
17     operations = [
18         migrations.CreateModel(
19             name='Author',
20             fields=[
21                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22                 ('name', models.CharField(help_text=b'Name of the author', max_length=100, unique=True)),
23                 ('notes', quotes.localmodels.HTMLField(blank=True, help_text=b'Notes about the author; may be left blank. Will                       not be HTML-escaped.')),
24                 ('pvt_notes', quotes.localmodels.HTMLField(blank=True, help_text=b'Notes about the author; not displayed on                           the public interface')),
25                 ('birth_date', models.DateField(blank=True, help_text=b'Date of birth', null=True)),
26                 ('death_date', models.DateField(blank=True, help_text=b'Date of death (leave blank                                   if still alive!)', null=True)),
27             ],
28         ),
29         migrations.CreateModel(
30             name='AuthorTag',
31             fields=[
32                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
33                 ('tag', models.CharField(max_length=100, unique=True)),
34             ],
35             options={
36                 'abstract': False,
37             },
38         ),
39         migrations.CreateModel(
40             name='Quote',
41             fields=[
42                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
43                 ('text', quotes.localmodels.HTMLField()),
44                 ('notes', quotes.localmodels.HTMLField(blank=True, help_text=b'Notes about the quote; may be left blank. Will                       not be HTML-escaped. XXX: offer a WYSIWYG editor')),
45                 ('pvt_notes', quotes.localmodels.HTMLField(blank=True, help_text=b'Notes about the quote; not displayed on                           the public interface')),
46             ],
47         ),
48         migrations.CreateModel(
49             name='QuoteTag',
50             fields=[
51                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
52                 ('tag', models.CharField(max_length=100, unique=True)),
53             ],
54             options={
55                 'abstract': False,
56             },
57         ),
58         migrations.CreateModel(
59             name='Work',
60             fields=[
61                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
62                 ('name', models.CharField(help_text=b'Name of the context for the quote                             (title of the work or speech it appears in)', max_length=100, unique=True)),
63                 ('date', models.DateField(blank=True, help_text=b'Date of the quote', null=True)),
64                 ('notes', quotes.localmodels.HTMLField(blank=True, help_text=b'Notes about the work; may be left blank. Will                       not be HTML-escaped. XXX: offer a WYSIWYG editor')),
65                 ('pvt_notes', quotes.localmodels.HTMLField(blank=True, help_text=b'Notes about the work; not displayed on                           the public interface')),
66                 ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='quotes.Author')),
67             ],
68         ),
69         migrations.CreateModel(
70             name='WorkTag',
71             fields=[
72                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
73                 ('tag', models.CharField(max_length=100, unique=True)),
74             ],
75             options={
76                 'abstract': False,
77             },
78         ),
79         migrations.AddField(
80             model_name='work',
81             name='tags',
82             field=models.ManyToManyField(blank=True, to='quotes.WorkTag'),
83         ),
84         migrations.AddField(
85             model_name='quote',
86             name='tags',
87             field=models.ManyToManyField(blank=True, to='quotes.QuoteTag'),
88         ),
89         migrations.AddField(
90             model_name='quote',
91             name='work',
92             field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='quotes.Work'),
93         ),
94         migrations.AddField(
95             model_name='author',
96             name='tags',
97             field=models.ManyToManyField(blank=True, to='quotes.AuthorTag'),
98         ),
99     ]