class ResponsableImplantationAdmin(admin.ModelAdmin):
actions = None
list_filter = ('region', 'statut', )
- list_display = ('nom', 'statut', '_responsable', )
+ list_display = ('_region', '_nom', 'statut', '_responsable', )
readonly_fields = ('nom', )
fields = ('nom', )
inlines = (ResponsableInline, )
-
+
+ def _region(self, obj):
+ return obj.region.code
+ _region.short_description = u"Région"
+ _region.admin_order_field = 'region__code'
+
+ def _nom(self, obj):
+ return obj.nom
+ _nom.short_description = u"Implantation"
+ _nom.admin_order_field = 'nom'
+
def _responsable(self, obj):
try:
employe = obj.responsable.employe