Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dc00d5f

Browse files
committed
agregados modelos Question y Choice y refactorización del código
1 parent 8918890 commit dc00d5f

File tree

11 files changed

+14
-5
lines changed

11 files changed

+14
-5
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎polls/apps.py‎ renamed to ‎apps/polls/apps.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class PollsConfig(AppConfig):
5-
name = 'polls'
5+
name = 'apps.polls'

‎apps/polls/migrations/__init__.py‎

Whitespace-only changes.

‎apps/polls/models.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django.db import models
2+
3+
# Create your models here.
4+
5+
class Question(models.Model):
6+
question_text = models.CharField(max_length=200)
7+
pub_date = models.DateTimeField('date published')
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)
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎mysite/urls.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818

1919
urlpatterns = [
2020
path('admin/', admin.site.urls),
21-
path('polls/', include('polls.urls')),
21+
path('polls/', include('apps.polls.urls')),
2222
]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /