I am currently going through the Django Documentation building the Polls App. And part 7 where there is the documentation asbout the Admin dashboard.
I have problem with this line of code which gives me error.
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
('Question', {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date']}),
]
inlines = [ChoiceInline]
list_display = ('question_text', 'pub_date', 'was_published_recently')
@admin.display(
boolean=True,
ordering='pub_date',
description='Published recently?',
was_publish_recently
is the problem here.
What could be the issue here.
here is the error code
# TypeError at /admin/poll/question/
was_published_recently() takes 1 positional argument but 2 were given