We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc00d5f commit 61e6ffbCopy full SHA for 61e6ffb
.gitignore
@@ -9,6 +9,9 @@ __pycache__/
9
#i dont know what is this folder
10
.idea/
11
12
+#migrations
13
+apps/polls/migrations
14
+
15
# Distribution / packaging
16
.Python
17
build/
apps/polls/models.py
@@ -1,12 +1,21 @@
1
from django.db import models
2
3
4
# Create your models here.
5
6
class Question(models.Model):
7
question_text = models.CharField(max_length=200)
8
pub_date = models.DateTimeField('date published')
+ def __str__(self):
+ return self.question_text
class Choice(models.Model):
- question =models.ForeignKey(Question, on_delete=models.CASCADE)
+ question =models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
- votes=models.IntegerField(default=0)
18
+ votes = models.IntegerField(default=0)
19
20
21
+ return self.choice_text
mysite/settings.py
@@ -31,6 +31,7 @@
31
# Application definition
32
33
INSTALLED_APPS = [
34
+ 'apps.polls.apps.PollsConfig',
35
'django.contrib.admin',
36
'django.contrib.auth',
37
'django.contrib.contenttypes',
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments