-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from VictorGM01/modelo-da-tarefa
Modelo da tarefa
- Loading branch information
Showing
4 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
from django.contrib import admin | ||
from .models import Tarefa | ||
|
||
# Register your models here. | ||
|
||
class Tarefas(admin.ModelAdmin): | ||
list_display = ("id", "titulo", "data", "concluida") | ||
list_display_links = ("id", "titulo") | ||
search_fields = ("titulo", ) | ||
list_editable = ('concluida', ) | ||
list_filter = ('concluida',) | ||
list_per_page = 10 | ||
|
||
|
||
admin.site.register(Tarefa, Tarefas) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 4.0.1 on 2022-12-24 03:33 | ||
|
||
import datetime | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Tarefa', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('titulo', models.CharField(max_length=100)), | ||
('data', models.DateField(blank=True, default=datetime.datetime(2022, 12, 24, 0, 33, 24, 242740))), | ||
('concluida', models.BooleanField(default=False)), | ||
('descricao', models.TextField(blank=True, max_length=500)), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.0.1 on 2022-12-24 03:41 | ||
|
||
import datetime | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('to_do_list', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='tarefa', | ||
name='data', | ||
field=models.DateField(blank=True, default=datetime.datetime(2022, 12, 24, 0, 41, 54, 367897)), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
from django.db import models | ||
from datetime import datetime | ||
|
||
# Create your models here. | ||
|
||
class Tarefa(models.Model): | ||
titulo = models.CharField(max_length=100) | ||
data = models.DateField(default=datetime.now(), blank=True) | ||
concluida = models.BooleanField(default=False) | ||
descricao = models.TextField(max_length=500, blank=True) | ||
|
||
def __str__(self): | ||
return self.titulo |