mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-10 09:02:20 +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)
|
@admin.register(Song)
|
||||||
class OrderAdmin(admin.ModelAdmin):
|
class SongAdmin(admin.ModelAdmin):
|
||||||
list_display = ('artist', 'title', 'user')
|
list_display = ('artist', 'title', 'user_name')
|
||||||
search_fields = ('artist', 'title', 'user')
|
search_fields = ('artist', 'title', 'user__name')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def user_name(obj):
|
||||||
|
return obj.user.name
|
||||||
|
|||||||
Reference in New Issue
Block a user