From 617771f4d53b603edca33dbd61768df1253a6a37 Mon Sep 17 00:00:00 2001 From: "jp.av.dev" Date: Sun, 15 Nov 2020 02:16:55 -0300 Subject: [PATCH] +admin.py --- TiendaOnline/gestionPedidos/admin.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 TiendaOnline/gestionPedidos/admin.py diff --git a/TiendaOnline/gestionPedidos/admin.py b/TiendaOnline/gestionPedidos/admin.py new file mode 100644 index 0000000..278bb04 --- /dev/null +++ b/TiendaOnline/gestionPedidos/admin.py @@ -0,0 +1,19 @@ +from django.contrib import admin +from gestionPedidos.models import Clientes, Articulos, Pedidos + +class ClientesAdmin(admin.ModelAdmin): + list_display = ("nombre", "direccion", "fono") + search_fields = ("nombre","fono") + +class ArticulosAdmin(admin.ModelAdmin): + list_filter = ("seccion",) + +class PedidosAdmin(admin.ModelAdmin): + list_display = ("numero", "fecha") + list_filter = ("fecha",) + date_hierarchy = "fecha" + +admin.site.register(Clientes, ClientesAdmin) +admin.site.register(Articulos, ArticulosAdmin) +admin.site.register(Pedidos, PedidosAdmin) +