mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 18:52:23 +01:00
Enable searching through songs.
Show name instead of username in the list of songs.
This commit is contained in:
@ -4,6 +4,10 @@ from .models import Song
|
||||
|
||||
|
||||
@admin.register(Song)
|
||||
class OrderAdmin(admin.ModelAdmin):
|
||||
list_display = ('artist', 'title', 'user')
|
||||
search_fields = ('artist', 'title', 'user')
|
||||
class SongAdmin(admin.ModelAdmin):
|
||||
list_display = ('artist', 'title', 'user_name')
|
||||
search_fields = ('artist', 'title', 'user__name')
|
||||
|
||||
@staticmethod
|
||||
def user_name(obj):
|
||||
return obj.user.name
|
||||
|
||||
Reference in New Issue
Block a user