Passing for Django 1.11.
[wolnelektury.git] / src / api / piston / migrations / 0001_initial.py
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3
4 from django.db import migrations, models
5 from django.conf import settings
6
7
8 class Migration(migrations.Migration):
9
10     dependencies = [
11         migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12     ]
13
14     operations = [
15         migrations.CreateModel(
16             name='Consumer',
17             fields=[
18                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
19                 ('name', models.CharField(max_length=255)),
20                 ('description', models.TextField()),
21                 ('key', models.CharField(max_length=18)),
22                 ('secret', models.CharField(max_length=32)),
23                 ('status', models.CharField(default=b'pending', max_length=16, choices=[(b'pending', b'Pending approval'), (b'accepted', b'Accepted'), (b'canceled', b'Canceled')])),
24                 ('user', models.ForeignKey(related_name='consumers', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
25             ],
26         ),
27         migrations.CreateModel(
28             name='Nonce',
29             fields=[
30                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
31                 ('token_key', models.CharField(max_length=18)),
32                 ('consumer_key', models.CharField(max_length=18)),
33                 ('key', models.CharField(max_length=255)),
34             ],
35         ),
36         migrations.CreateModel(
37             name='Resource',
38             fields=[
39                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
40                 ('name', models.CharField(max_length=255)),
41                 ('url', models.TextField(max_length=2047)),
42                 ('is_readonly', models.BooleanField(default=True)),
43             ],
44         ),
45         migrations.CreateModel(
46             name='Token',
47             fields=[
48                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
49                 ('key', models.CharField(max_length=18)),
50                 ('secret', models.CharField(max_length=32)),
51                 ('token_type', models.IntegerField(choices=[(1, 'Request'), (2, 'Access')])),
52                 ('timestamp', models.IntegerField()),
53                 ('is_approved', models.BooleanField(default=False)),
54                 ('consumer', models.ForeignKey(to='piston.Consumer')),
55                 ('user', models.ForeignKey(related_name='tokens', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
56             ],
57         ),
58     ]