29 lines
864 B
Python
29 lines
864 B
Python
from django.contrib import admin
|
|
from .models import Document, DocumentType, Fuente
|
|
|
|
# Register your models here.
|
|
|
|
class DocumentAdmin(admin.ModelAdmin):
|
|
model = Document
|
|
list_display = ('id', 'pedimento', 'archivo', 'size', 'extension', 'created_at', 'updated_at')
|
|
search_fields = ('pedimento.pedimento', 'archivo')
|
|
list_filter = ('created_at', 'updated_at')
|
|
|
|
class DocumentTypeAdmin(admin.ModelAdmin):
|
|
model = DocumentType
|
|
list_display = ('id', 'nombre', 'descripcion')
|
|
search_fields = ('nombre',)
|
|
ordering = ('nombre',)
|
|
|
|
|
|
class FuenteAdmin(admin.ModelAdmin):
|
|
model = Fuente
|
|
list_display = ('id', 'nombre', 'descripcion')
|
|
search_fields = ('nombre',)
|
|
ordering = ('nombre',)
|
|
|
|
|
|
|
|
admin.site.register(Document, DocumentAdmin)
|
|
admin.site.register(DocumentType, DocumentTypeAdmin)
|
|
admin.site.register(Fuente, FuenteAdmin) |