Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
# admin.py
class LectModel(admin.ModelAdmin):
...
search_fields = ['title', 'discipline__name'] # Здесь указать нужные поля
# discipline__name - поиск по внешнему ключу где __name - название поля связанной таблицы.
...
admin.site.register(Discipline, DisModel)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question