-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001_initial.py
51 lines (46 loc) · 1.8 KB
/
0001_initial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('first_name', models.CharField(max_length=30)),
('last_name', models.CharField(max_length=40)),
('email', models.EmailField(max_length=254)),
],
),
migrations.CreateModel(
name='Book',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('title', models.CharField(max_length=100)),
('publicatithon_date', models.DateField()),
('authors', models.ManyToManyField(to='books.Author')),
],
),
migrations.CreateModel(
name='Publisher',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=30)),
('address', models.CharField(max_length=50)),
('city', models.CharField(max_length=60)),
('state_province', models.CharField(max_length=30)),
('country', models.CharField(max_length=50)),
('website', models.URLField()),
],
options={
'ordering': ['name'],
},
),
migrations.AddField(
model_name='book',
name='publisher',
field=models.ForeignKey(to='books.Publisher'),
),
]