|
@@ -10,9 +10,14 @@ admin.site.register(TipoRadio)
|
|
|
class UserAdmin(auth.admin.UserAdmin):
|
|
|
pass
|
|
|
|
|
|
-
|
|
|
+from django.utils.html import format_html
|
|
|
@admin.register(RapportoRicezione)
|
|
|
class RapportoAdmin(admin.ModelAdmin):
|
|
|
- list_display = ('id', 'indirizzo', 'created', 'author')
|
|
|
- list_filter = ('author', 'created')
|
|
|
+ # TODO: comprensibile dovrebbe essere un pallino colorato
|
|
|
+ list_display = ('id', 'indirizzo', 'color_circle', 'created', 'author')
|
|
|
+ list_filter = ('author', 'created', 'comprensibile')
|
|
|
search_fields = ('indirizzo',)
|
|
|
+ def color_circle(self, x):
|
|
|
+ return format_html('<span style="color: {}">●</span>', x.colore)
|
|
|
+ color_circle.allow_tags = True
|
|
|
+ color_circle.description = 'Comprensibilità'
|