Add: furaffinity admin config
This commit is contained in:
parent
6af7e818d2
commit
0569feb588
1 changed files with 32 additions and 0 deletions
32
archivist/sites/furaffinity/admin.py
Normal file
32
archivist/sites/furaffinity/admin.py
Normal 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,)
|
Loading…
Reference in a new issue