30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
from django.contrib import admin
|
|
from .models import Bounty, BountyApplication, BountyComment
|
|
|
|
|
|
@admin.register(Bounty)
|
|
class BountyAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'title', 'reward', 'publisher', 'acceptor', 'status', 'is_paid', 'created_at']
|
|
list_filter = ['status', 'is_paid', 'is_escrowed']
|
|
search_fields = ['title', 'description']
|
|
ordering = ['-created_at']
|
|
raw_id_fields = ['publisher', 'acceptor']
|
|
|
|
|
|
@admin.register(BountyApplication)
|
|
class BountyApplicationAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'bounty', 'applicant', 'status', 'created_at']
|
|
list_filter = ['status']
|
|
search_fields = ['bounty__title', 'applicant__name']
|
|
ordering = ['-created_at']
|
|
raw_id_fields = ['bounty', 'applicant']
|
|
|
|
|
|
@admin.register(BountyComment)
|
|
class BountyCommentAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'bounty', 'user', 'parent', 'created_at']
|
|
list_filter = ['bounty']
|
|
search_fields = ['content', 'user__name']
|
|
ordering = ['-created_at']
|
|
raw_id_fields = ['bounty', 'user', 'parent']
|