update 6 files
This commit is contained in:
Binary file not shown.
Binary file not shown.
32
polls/migrations/0001_initial.py
Normal file
32
polls/migrations/0001_initial.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# Generated by Django 6.0.5 on 2026-05-20 00:55
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Question',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('question_text', models.CharField(max_length=200, verbose_name='Pergunta')),
|
||||
('pub_date', models.DateTimeField(max_length=10, verbose_name='Data de publicação')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Choice',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('choice_text', models.CharField(max_length=200)),
|
||||
('votes', models.IntegerField(default=0)),
|
||||
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.question')),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -1,3 +1,13 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
# Creafrom django.db import models
|
||||
|
||||
class Question(models.Model):
|
||||
question_text = models.CharField("Pergunta", max_length=200)
|
||||
pub_date = models.DateTimeField("Data de publicação", max_length=10)
|
||||
|
||||
class Choice(models.Model):
|
||||
question = models.ForeignKey(Question, on_delete=models.CASCADE)
|
||||
choice_text = models.CharField(max_length=200)
|
||||
votes = models.IntegerField(default=0)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from django.shortcuts import render
|
||||
from django.http import HttpResponse
|
||||
|
||||
def index(request):
|
||||
return render(request, 'index.html',{'titulo:':'Django Polls App'})
|
||||
return render(request, 'index.html',{'titulo':'Django Polls App'})
|
||||
|
||||
def ola(request):
|
||||
return HttpResponse("Olá !!")
|
||||
|
||||
Reference in New Issue
Block a user