Skip to content

Commit d6df133

Browse files
committed
Activating models -- make migrations
python manage.py makemigrations polls https://docs.djangoproject.com/en/1.8/intro/tutorial01/#activating-models
1 parent d623473 commit d6df133

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import models, migrations
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
]
11+
12+
operations = [
13+
migrations.CreateModel(
14+
name='Choice',
15+
fields=[
16+
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
17+
('choice_text', models.CharField(max_length=200)),
18+
('votes', models.IntegerField(default=0)),
19+
],
20+
),
21+
migrations.CreateModel(
22+
name='Question',
23+
fields=[
24+
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
25+
('question_text', models.CharField(max_length=200)),
26+
('pub_date', models.DateTimeField(verbose_name=b'date published')),
27+
],
28+
),
29+
migrations.AddField(
30+
model_name='choice',
31+
name='question',
32+
field=models.ForeignKey(to='polls.Question'),
33+
),
34+
]

0 commit comments

Comments
 (0)