admin.py 821 Bytes
Newer Older
1
from funkwhale_api.common import admin
2
3
4
5
6
7

from . import models


@admin.register(models.Radio)
class RadioAdmin(admin.ModelAdmin):
Eliot Berriot's avatar
Eliot Berriot committed
8
9
10
11
    list_display = ["user", "name", "is_public", "creation_date", "config"]
    list_select_related = ["user"]
    list_filter = ["is_public"]
    search_fields = ["name", "description"]
12
13
14
15
16


@admin.register(models.RadioSession)
class RadioSessionAdmin(admin.ModelAdmin):
    list_display = [
Eliot Berriot's avatar
Eliot Berriot committed
17
18
19
20
21
        "user",
        "custom_radio",
        "radio_type",
        "creation_date",
        "related_object",
22
23
    ]

Eliot Berriot's avatar
Eliot Berriot committed
24
25
26
    list_select_related = ["user", "custom_radio"]
    list_filter = ["radio_type"]

27
28
29

@admin.register(models.RadioSessionTrack)
class RadioSessionTrackAdmin(admin.ModelAdmin):
Eliot Berriot's avatar
Eliot Berriot committed
30
31
32
    list_display = ["id", "session", "position", "track"]

    list_select_related = ["track", "session"]