0
0
Djangoframework~10 mins

List display configuration in Django - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the list display to show the 'title' field in Django admin.

Django
class BookAdmin(admin.ModelAdmin):
    list_display = ('[1]',)
Drag options to blanks, or click blank then click option'
Aisbn
Bauthor
Cdate
Dtitle
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put the field name in quotes.
Using a field name that does not exist in the model.
2fill in blank
medium

Complete the code to add 'author' to the list display in Django admin.

Django
class BookAdmin(admin.ModelAdmin):
    list_display = ('title', '[1]')
Drag options to blanks, or click blank then click option'
Aauthor
Bdate
Cpublisher
Disbn
Attempts:
3 left
💡 Hint
Common Mistakes
Using a field name not defined in the model.
Forgetting the comma between tuple items.
3fill in blank
hard

Fix the error in the list_display tuple to correctly show 'title' and 'author'.

Django
class BookAdmin(admin.ModelAdmin):
    list_display = ('title'[1]'author')
Drag options to blanks, or click blank then click option'
A+
B;
C,
Dand
Attempts:
3 left
💡 Hint
Common Mistakes
Using plus or other operators instead of commas.
Missing commas causing syntax errors.
4fill in blank
hard

Fill both blanks to configure list_display to show 'title' and 'published_date'.

Django
class BookAdmin(admin.ModelAdmin):
    list_display = ('[1]', '[2]')
Drag options to blanks, or click blank then click option'
Atitle
Bauthor
Cpublished_date
Disbn
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect field names.
Forgetting to put field names in quotes.
5fill in blank
hard

Fill all three blanks to configure list_display to show 'title', 'author', and 'isbn'.

Django
class BookAdmin(admin.ModelAdmin):
    list_display = ('[1]', '[2]', '[3]')
Drag options to blanks, or click blank then click option'
Apublished_date
Bauthor
Cisbn
Dtitle
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up field names or misspelling them.
Omitting commas between fields.