Skip to content

Instantly share code, notes, and snippets.

@aballah-chamakh
Created July 14, 2019 07:28
Show Gist options
  • Select an option

  • Save aballah-chamakh/5c6f7e5b195c209943496c684b003304 to your computer and use it in GitHub Desktop.

Select an option

Save aballah-chamakh/5c6f7e5b195c209943496c684b003304 to your computer and use it in GitHub Desktop.
from django.contrib import admin
from .models import Lecture
class LectureAdmin(admin.ModelAdmin):
list_display = ('title','slug','video_url','description_length')
list_display_link = ('slug')
iist_diplay_editable = ('title','video_url')
list_display_filter = ('title')
list_display_search = ('title','description')
def description_length(self,obj) :
return len(self.obj.description)
admin.site.register(Lecture,LectureAdmin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment