Gallery-Archivist/archivist/sites/furaffinity/admin.py

32 lines
No EOL
1 KiB
Python

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,)