mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Add searchfield Blacklists, and use count() for recommendation count
This commit is contained in:
@@ -9,7 +9,7 @@ class ApplicationAdmin(admin.ModelAdmin):
|
|||||||
list_filter = ('status',)
|
list_filter = ('status',)
|
||||||
|
|
||||||
def recommendations(self, obj):
|
def recommendations(self, obj):
|
||||||
return len(obj.recommendation_set.all())
|
return obj.recommendation_set.all().count()
|
||||||
|
|
||||||
recommendations.short_description = '# of Recommendations'
|
recommendations.short_description = '# of Recommendations'
|
||||||
|
|
||||||
@@ -33,6 +33,7 @@ admin.site.register(Audit, AuditAdmin)
|
|||||||
class BlacklistAdmin(admin.ModelAdmin):
|
class BlacklistAdmin(admin.ModelAdmin):
|
||||||
list_display = ('type', 'value', 'source', 'created_date', 'created_by')
|
list_display = ('type', 'value', 'source', 'created_date', 'created_by')
|
||||||
list_filter = ('source', 'type')
|
list_filter = ('source', 'type')
|
||||||
|
search_fields = ('value')
|
||||||
|
|
||||||
admin.site.register(Blacklist, BlacklistAdmin)
|
admin.site.register(Blacklist, BlacklistAdmin)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user