You've already forked Curso-lenguaje-python
@@ -0,0 +1,19 @@
|
||||
<h1>Lista de pendientes</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Elementos</th>
|
||||
</tr>
|
||||
|
||||
{% for tarea in tareas %}
|
||||
|
||||
<tr>
|
||||
<td>{{ tarea.titulo }}</td>
|
||||
</tr>
|
||||
|
||||
{% empty %}
|
||||
<h3>No hay elementos en esta lista</h3>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.urls import path
|
||||
from . import views
|
||||
from .views import ListaPendientes
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.lista_pendientes, name='pendientes')
|
||||
path('', ListaPendientes.as_view(), name='pendientes')
|
||||
]
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
from django.shortcuts import render
|
||||
from django.http import HttpResponse
|
||||
from django.views.generic.list import ListView
|
||||
from .models import Tarea
|
||||
|
||||
# Create your views here.
|
||||
|
||||
|
||||
def lista_pendientes(pedido):
|
||||
return HttpResponse('Lista de pendientes')
|
||||
class ListaPendientes(ListView):
|
||||
model = Tarea
|
||||
context_object_name = 'tareas'
|
||||
|
||||
@@ -55,7 +55,7 @@ ROOT_URLCONF = 'proyecto.urls'
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'DIRS': ['../base/templates'],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
|
||||
Reference in New Issue
Block a user