Add: furaffinity admin config

This commit is contained in:
Aroy-Art 2023-10-21 16:41:35 +02:00
parent 6af7e818d2
commit 0569feb588
Signed by: Aroy
GPG key ID: DB9689E9391DD156

View file

@ -0,0 +1,32 @@
from django.contrib import admin
from .models import FA_Submission, FA_Submission_File, FA_Tags, FA_User, FA_Species, FA_Gender
# Register your models here.
class FA_UserAdmin(admin.ModelAdmin):
fieldsets = (
("Artist Name", { "fields": ["artist", "artist_url"], } ),
)
class FA_TagsAdmin(admin.ModelAdmin):
@admin.display(description='Tag Name')
def upper_case_tag(obj):
return ("%s" % (obj.tag).capitalize())
list_display = (upper_case_tag,)
class FA_SubmissionAdmin(admin.ModelAdmin):
list_display = ('submission_id', 'title', 'artist', 'date', 'date_added', 'mature_rating',)
class FA_Submission_FileAdmin(admin.ModelAdmin):
list_display = ('file_name', 'date_added', 'file_hash', 'file',)
admin.site.register(FA_User, FA_UserAdmin,)
admin.site.register(FA_Tags, FA_TagsAdmin,)
admin.site.register(FA_Species,)
admin.site.register(FA_Gender,)
admin.site.register(FA_Submission, FA_SubmissionAdmin,)
admin.site.register(FA_Submission_File, FA_Submission_FileAdmin,)