add description length to room admin list
This commit is contained in:
parent
5ce4c44b6a
commit
56d4202b56
|
@ -3,7 +3,15 @@ from django.contrib.admin import DateFieldListFilter
|
|||
|
||||
from .models import Room, Shift, Helper, ShiftRegistration, Message, LoginToken
|
||||
|
||||
admin.site.register(Room)
|
||||
|
||||
@admin.register(Room)
|
||||
class RoomAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "description_length")
|
||||
|
||||
def description_length(self, object):
|
||||
if object.description:
|
||||
return len(object.description)
|
||||
return 0
|
||||
|
||||
|
||||
@admin.register(Shift)
|
||||
|
|
Loading…
Reference in New Issue