intro_Django/TiendaOnline/gestionPedidos/admin.py

20 lines
570 B
Python
Raw Normal View History

2020-11-15 02:16:55 -03:00
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)