from django.contrib import admin
from .models import Review, CustomReply, Reply


class ReviewAdmin(admin.ModelAdmin):
    list_display = ('reviewer_name', 'star_rating', 'comment')
    list_filter = ('location', 'star_rating',)
    ordering = ['-update_time']
    search_fields = ['star_rating', 'reviewer_name', 'comment', 'review_id']


class CustomReplyAdmin(admin.ModelAdmin):
    list_display = ('reply_category', 'reply')
    list_filter = ('reply_category',)


class ReplyAdmin(admin.ModelAdmin):
    list_display = ('id', 'review', 'replied_text',)
    ordering = ['-create_time']


admin.site.register(Review, ReviewAdmin)
admin.site.register(CustomReply, CustomReplyAdmin)
admin.site.register(Reply, ReplyAdmin)
