Update day 16

Signed-off-by: Manuel Vergara <manuel@vergaracarmona.es>
This commit is contained in:
2023-05-21 19:21:17 +02:00
parent 15ae6ed3da
commit 33e2f1b72f
6 changed files with 56 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
<h1>Tarea: {{tarea}} </h1>

View File

@@ -1,7 +1,8 @@
from django.urls import path
from .views import ListaPendientes
from .views import ListaPendientes, DetalleTarea
urlpatterns = [
path('', ListaPendientes.as_view(), name='pendientes')
path('', ListaPendientes.as_view(), name='pendientes'),
path('tarea/<int:pk>', DetalleTarea.as_view(), name='tarea')
]

View File

@@ -1,5 +1,6 @@
from django.shortcuts import render
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import Tarea
# Create your views here.
@@ -8,3 +9,9 @@ from .models import Tarea
class ListaPendientes(ListView):
model = Tarea
context_object_name = 'tareas'
class DetalleTarea(DetailView):
model = Tarea
context_object_name = 'tarea'
template_name = 'base/tarea.html'