Ratings: implement replies by maintainers #181
@ -7,25 +7,6 @@ from extensions.models import Version
|
||||
from .models import Rating
|
||||
|
||||
|
||||
class RatingTypeFilter(admin.SimpleListFilter):
|
||||
# Human-readable title which will be displayed in the
|
||||
# right admin sidebar just above the filter options.
|
||||
title = 'Type'
|
||||
|
||||
# Parameter for the filter that will be used in the URL query.
|
||||
parameter_name = 'type'
|
||||
|
||||
def lookups(self, request, model_admin):
|
||||
"""Return a list of lookup option tuples.
|
||||
|
||||
The first element in each tuple is the coded value
|
||||
for the option that will appear in the URL query.
|
||||
The second element is the human-readable name for
|
||||
the option that will appear in the right sidebar.
|
||||
"""
|
||||
return (('rating', 'User Rating'),)
|
||||
|
||||
|
||||
class RatingAdmin(admin.ModelAdmin):
|
||||
date_hierarchy = 'date_created'
|
||||
search_fields = ('extension__slug', 'extension__name', 'user__email', 'user__full_name')
|
||||
@ -53,7 +34,7 @@ class RatingAdmin(admin.ModelAdmin):
|
||||
'status',
|
||||
'truncated_text',
|
||||
)
|
||||
list_filter = ('status', RatingTypeFilter, 'score')
|
||||
list_filter = ('status', 'score')
|
||||
actions = ('delete_selected',)
|
||||
list_select_related = ('user',)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user