Federation model admin

merge-requests/154/head
Eliot Berriot 2018-04-08 13:33:46 +02:00
rodzic 206ae296b6
commit 92fa348eac
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
1 zmienionych plików z 77 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,77 @@
from django.contrib import admin
from . import models
@admin.register(models.Actor)
class ActorAdmin(admin.ModelAdmin):
list_display = [
'url',
'domain',
'preferred_username',
'type',
'creation_date',
'last_fetch_date']
search_fields = ['url', 'domain', 'preferred_username']
list_filter = [
'type'
]
@admin.register(models.Follow)
class FollowAdmin(admin.ModelAdmin):
list_display = [
'actor',
'target',
'creation_date'
]
search_fields = ['actor__url', 'target__url']
list_select_related = True
@admin.register(models.FollowRequest)
class FollowRequestAdmin(admin.ModelAdmin):
list_display = [
'actor',
'target',
'creation_date',
'approved'
]
search_fields = ['actor__url', 'target__url']
list_filter = [
'approved'
]
list_select_related = True
@admin.register(models.Library)
class LibraryAdmin(admin.ModelAdmin):
list_display = [
'actor',
'url',
'creation_date',
'fetched_date',
'tracks_count']
search_fields = ['actor__url', 'url']
list_filter = [
'federation_enabled',
'download_files',
'autoimport',
]
list_select_related = True
@admin.register(models.LibraryTrack)
class LibraryTrackAdmin(admin.ModelAdmin):
list_display = [
'title',
'artist_name',
'album_title',
'url',
'library',
'creation_date',
'published_date',
]
search_fields = [
'library__url', 'url', 'artist_name', 'title', 'album_title']
list_select_related = True