From 83bcc1828a405921d5d2e3173bfc0912cbdd7cff Mon Sep 17 00:00:00 2001 From: "Victor G. Marques" Date: Thu, 5 Jan 2023 12:57:35 -0300 Subject: [PATCH 1/2] fix: corrige valor do campo de data --- to_do_list/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/to_do_list/models.py b/to_do_list/models.py index 1bf2a55..9926e5e 100644 --- a/to_do_list/models.py +++ b/to_do_list/models.py @@ -1,10 +1,10 @@ from django.db import models -from django.utils import timezone +from datetime import date class Tarefa(models.Model): titulo = models.CharField(max_length=100) - data_de_conclusao = models.DateField(default=timezone.now, blank=True, null=True) + data_de_conclusao = models.DateField(default=date.today, blank=True, null=True) concluida = models.BooleanField(default=False) descricao = models.TextField(max_length=500, blank=True) From 80ceac36112f7ca4fecadc653093853c9d7a8bb3 Mon Sep 17 00:00:00 2001 From: "Victor G. Marques" Date: Thu, 5 Jan 2023 13:31:53 -0300 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20cria=20a=20migra=C3=A7=C3=A3o=20da?= =?UTF-8?q?=20altera=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0004_alter_tarefa_data_de_conclusao.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 to_do_list/migrations/0004_alter_tarefa_data_de_conclusao.py diff --git a/to_do_list/migrations/0004_alter_tarefa_data_de_conclusao.py b/to_do_list/migrations/0004_alter_tarefa_data_de_conclusao.py new file mode 100644 index 0000000..dbf4a75 --- /dev/null +++ b/to_do_list/migrations/0004_alter_tarefa_data_de_conclusao.py @@ -0,0 +1,19 @@ +# Generated by Django 4.1.5 on 2023-01-05 15:59 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('to_do_list', '0003_remove_tarefa_data_tarefa_data_de_conclusao'), + ] + + operations = [ + migrations.AlterField( + model_name='tarefa', + name='data_de_conclusao', + field=models.DateField(blank=True, default=datetime.date.today, null=True), + ), + ]