Drill 5: Find the core line — The Django admin
Point to the line that does the main work and explain why.
What you will be able to do
- Point to the line that does the main work and explain why.
Practice task
Point to the line that does the main work and explain why.
from django.contrib import admin
from .models import Course, Lesson
@admin.register(Course)
class CourseAdmin(admin.ModelAdmin):
list_display = ('title', 'slug', 'created_at')
search_fields = ('title', 'slug')
@admin.register(Lesson)
class LessonAdmin(admin.ModelAdmin):
list_display = ('title', 'course', 'minutes', 'published')
list_filter = ('published', 'course')Your turn
EasyWrite your answer
Point to the line that does the main work and explain why.
TEXT · starter
Your answer…Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.