ladogton2010 commited on
Commit
c611751
·
1 Parent(s): 01da5fc

modelos agregados

Browse files
Files changed (2) hide show
  1. app/mysite/settings.py +1 -0
  2. app/polls/models.py +10 -1
app/mysite/settings.py CHANGED
@@ -32,6 +32,7 @@ ALLOWED_HOSTS = ['*']
32
  # Application definition
33
 
34
  INSTALLED_APPS = [
 
35
  'django.contrib.admin',
36
  'django.contrib.auth',
37
  'django.contrib.contenttypes',
 
32
  # Application definition
33
 
34
  INSTALLED_APPS = [
35
+ 'polls.app.PollsConfig',
36
  'django.contrib.admin',
37
  'django.contrib.auth',
38
  'django.contrib.contenttypes',
app/polls/models.py CHANGED
@@ -1,3 +1,12 @@
1
  from django.db import models
2
 
3
- # Create your models here.
 
 
 
 
 
 
 
 
 
 
1
  from django.db import models
2
 
3
+
4
+ class Question(models.Model):
5
+ question_text = models.CharField(max_length=200)
6
+ pub_date = models.DateTimeField('date published')
7
+
8
+
9
+ class Choice(models.Model):
10
+ question = models.ForeignKey(Question, on_delete=models.CASCADE)
11
+ choice_text = models.CharField(max_length=200)
12
+ votes = models.IntegerField(default=0)