Listing des postes, affichage du service en rouge si supprimé
authorJean-Philippe Caissy <jpcaissy@piji.ca>
Wed, 22 Feb 2012 17:28:37 +0000 (11:28 -0600)
committerJean-Philippe Caissy <jpcaissy@piji.ca>
Wed, 22 Feb 2012 17:28:37 +0000 (11:28 -0600)
project/rh/admin.py

index eaa0642..1c03e73 100644 (file)
@@ -607,8 +607,12 @@ class PosteAdmin(DateRangeMixin, AUFMetadataAdminMixin, ProtectRegionMixin, admi
     _id.admin_order_field = 'id'
 
     def _service(self, obj):
-        return obj.service
+        if obj.service.supprime:
+            return """<span style="color:red">%s</span>""" % obj.service
+        else:
+            return obj.service
     _service.short_description = 'Service'
+    _service.allow_tags = True
 
     def _responsable(self, obj):
         try: