diora-web/accounts/admin.py

15 lines
479 B
Python
Raw Permalink Normal View History

from django.contrib import admin
from .models import UserProfile
@admin.register(UserProfile)
class UserProfileAdmin(admin.ModelAdmin):
list_display = ('user', 'lastfm_username', 'lastfm_scrobble', 'has_background')
search_fields = ('user__username', 'lastfm_username')
raw_id_fields = ('user',)
def has_background(self, obj):
return bool(obj.background_image_data)
has_background.boolean = True
has_background.short_description = 'Background'