Answer the question
In order to leave comments, you need to log in
What am I doing wrong when working with the Django admin panel?
I need to add a database search to the Django admin panel and make some data appear in the preview
What am I doing wrong?
from django.contrib import admin
from .models import WorkingBase
from .models import Blacklist
admin.site.register(WorkingBase)
admin.site.register(Blacklist)
class WorkingBaseAdmin(admin.ModelAdmin):
list_display=('title', 'price3')
search_fields=('title')
admin.site.register(WorkingBase)
class WorkingBaseAdmin(admin.ModelAdmin):
list_display=('title', 'price3')
search_fields=('title')
admin.site.register(WorkingBase)
Answer the question
In order to leave comments, you need to log in
I understand admin.py looks like this? (First block of code)
from django.contrib import admin
from .models import WorkingBase
from .models import Blacklist
admin.site.register(WorkingBase) # Первое подключение WorkingBase
admin.site.register(Blacklist)
class WorkingBaseAdmin(admin.ModelAdmin):
list_display=('title', 'price3')
search_fields=('title')
admin.site.register(WorkingBase) # Второе подключение WorkingBase
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question