0001_initial.py 6.12 KB
Newer Older
Skia's avatar
Skia committed
1
2
3
4
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
5
6
import django.utils.timezone
import django.core.validators
7
import django.db.models.deletion
8
from django.conf import settings
Skia's avatar
Skia committed
9
import django.contrib.auth.models
Skia's avatar
Skia committed
10
11
12
13
14


class Migration(migrations.Migration):

    dependencies = [
15
        ('auth', '__first__'),
Skia's avatar
Skia committed
16
17
18
19
20
21
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
22
                ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
Skia's avatar
Skia committed
23
                ('password', models.CharField(verbose_name='password', max_length=128)),
24
25
26
                ('last_login', models.DateTimeField(null=True, blank=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(help_text='Designates that this user has all permissions without explicitly assigning them.', default=False, verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 254 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=254, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.')], unique=True, verbose_name='username')),
Skia's avatar
Skia committed
27
28
                ('first_name', models.CharField(verbose_name='first name', max_length=30)),
                ('last_name', models.CharField(verbose_name='last name', max_length=30)),
29
                ('email', models.EmailField(unique=True, verbose_name='email address', max_length=254)),
Skia's avatar
Skia committed
30
31
                ('date_of_birth', models.DateTimeField(verbose_name='date of birth')),
                ('nick_name', models.CharField(blank=True, max_length=30)),
32
33
34
                ('is_staff', models.BooleanField(help_text='Designates whether the user can log into this admin site.', default=False, verbose_name='staff status')),
                ('is_active', models.BooleanField(help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', default=True, verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
Skia's avatar
Skia committed
35
36
            ],
            options={
37
                'verbose_name_plural': 'users',
38
39
                'permissions': (('change_prop_user', "Can change the user's properties (groups, ...)"), ('view_user', "Can view user's profile")),
                'verbose_name': 'user',
Skia's avatar
Skia committed
40
41
42
43
44
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
45
46
47
48
49
50
51
        migrations.CreateModel(
            name='Group',
            fields=[
                ('group_ptr', models.OneToOneField(primary_key=True, to='auth.Group', parent_link=True, serialize=False, auto_created=True)),
            ],
            bases=('auth.group',),
        ),
52
53
54
        migrations.CreateModel(
            name='Page',
            fields=[
55
                ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
56
                ('name', models.CharField(verbose_name='page name', max_length=30)),
57
58
59
60
61
                ('full_name', models.CharField(blank=True, verbose_name='page name', max_length=255)),
                ('edit_group', models.ManyToManyField(blank=True, to='core.Group', related_name='editable_page')),
                ('owner_group', models.ForeignKey(to='core.Group', default=1, related_name='owned_page')),
                ('parent', models.ForeignKey(null=True, to='core.Page', on_delete=django.db.models.deletion.SET_NULL, blank=True, related_name='children')),
                ('view_group', models.ManyToManyField(blank=True, to='core.Group', related_name='viewable_page')),
62
63
            ],
            options={
64
                'permissions': (('change_prop_page', "Can change the page's properties (groups, ...)"), ('view_page', 'Can view the page')),
65
66
            },
        ),
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
        migrations.CreateModel(
            name='PageRev',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
                ('title', models.CharField(blank=True, verbose_name='page title', max_length=255)),
                ('content', models.TextField(blank=True, verbose_name='page content')),
                ('date', models.DateTimeField(verbose_name='date', auto_now=True)),
                ('author', models.ForeignKey(related_name='page_rev', to=settings.AUTH_USER_MODEL)),
                ('page', models.ForeignKey(related_name='revisions', to='core.Page')),
            ],
            options={
                'ordering': ['date'],
            },
        ),
        migrations.AddField(
            model_name='user',
            name='edit_group',
            field=models.ManyToManyField(blank=True, to='core.Group', related_name='editable_user'),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', to='auth.Group', blank=True, verbose_name='groups', related_query_name='user', related_name='user_set'),
        ),
        migrations.AddField(
            model_name='user',
            name='owner_group',
            field=models.ForeignKey(to='core.Group', default=1, related_name='owned_user'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(help_text='Specific permissions for this user.', to='auth.Permission', blank=True, verbose_name='user permissions', related_query_name='user', related_name='user_set'),
        ),
        migrations.AddField(
            model_name='user',
            name='view_group',
            field=models.ManyToManyField(blank=True, to='core.Group', related_name='viewable_user'),
        ),
106
107
108
109
        migrations.AlterUniqueTogether(
            name='page',
            unique_together=set([('name', 'parent')]),
        ),
Skia's avatar
Skia committed
110
    ]