|
@@ -102,8 +102,7 @@ ends_resource.short_description = 'Terminer les allocations sélectionnées'
|
|
|
### ModelAdmin
|
|
|
|
|
|
class ServiceAdmin(admin.ModelAdmin):
|
|
|
- list_display = ('id', 'adhesion', 'get_adherent_link', 'service_type', 'label', 'active')
|
|
|
- list_display_links = ('adhesion',)
|
|
|
+ list_display = ('id', 'get_adhesion_link', 'get_adherent_link', 'service_type', 'label', 'active')
|
|
|
list_select_related = ('adhesion',) # to reduce database requests
|
|
|
list_filter = (
|
|
|
'active',
|
|
@@ -113,6 +112,9 @@ class ServiceAdmin(admin.ModelAdmin):
|
|
|
search_fields = ('id', 'service_type__name', 'label', 'adhesion__id',)
|
|
|
raw_id_fields = ('adhesion',)
|
|
|
|
|
|
+ get_adhesion_link = lambda self, service: service.adhesion.get_adhesion_link()
|
|
|
+ get_adhesion_link.short_description = Adhesion.get_adhesion_link.short_description
|
|
|
+
|
|
|
get_adherent_link = lambda self, service: service.adhesion.get_adherent_link()
|
|
|
get_adherent_link.short_description = Adhesion.get_adherent_link.short_description
|
|
|
|