I will assume that your model is a Part with the attributes parte
, activo
and descripcion
. To enable the search engine and filters go to the file 'admin.py' that is in the folder of your application and write the following code:
class ParteAdmin(admin.ModelAdmin):
# con esto muestras los campos que deses al mostrar la lista en admin
list_display=['parte', 'activo']
# con esto añades un campo de texto que te permite realizar la busqueda, puedes añadir mas de un atributo por el cual se filtrará
search_fields = ['parte', 'descripcion']
# con esto añadiras una lista desplegable con la que podras filtrar (activo es un atributo booleano)
list_filter = ['activo']
at the end of the file admin.py
you have to register your custom model
admin.site.register(Parte, ParteAdmin)
the first parameter is the model and the second the class that we just made