Librarian 1.8
[wolnelektury.git] / src / libraries / migrations / 0001_initial.py
1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
3 #
4 from django.db import models, migrations
5 import django.db.models.deletion
6
7
8 class Migration(migrations.Migration):
9
10     dependencies = [
11     ]
12
13     operations = [
14         migrations.CreateModel(
15             name='Catalog',
16             fields=[
17                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
18                 ('name', models.CharField(max_length=120, verbose_name='name')),
19                 ('slug', models.SlugField(unique=True, max_length=120, verbose_name='Slug')),
20             ],
21             options={
22                 'verbose_name': 'catalog',
23                 'verbose_name_plural': 'catalogs',
24             },
25             bases=(models.Model,),
26         ),
27         migrations.CreateModel(
28             name='Library',
29             fields=[
30                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
31                 ('name', models.CharField(max_length=120, verbose_name='name', blank=True)),
32                 ('slug', models.SlugField(max_length=120, unique=True, null=True, verbose_name='Slug')),
33                 ('url', models.CharField(max_length=120, verbose_name='url', blank=True)),
34                 ('description', models.TextField(verbose_name='Description', blank=True)),
35                 ('catalog', models.ForeignKey(related_name='libraries', on_delete=django.db.models.deletion.PROTECT, to='libraries.Catalog')),
36             ],
37             options={
38                 'verbose_name': 'library',
39                 'verbose_name_plural': 'libraries',
40             },
41             bases=(models.Model,),
42         ),
43     ]