PEP8
authorEric Mc Sween <eric.mcsween@auf.org>
Wed, 12 Dec 2012 16:12:14 +0000 (11:12 -0500)
committerEric Mc Sween <eric.mcsween@auf.org>
Wed, 12 Dec 2012 16:12:14 +0000 (11:12 -0500)
project/rh/admin.py

index c257513..d2813f5 100644 (file)
@@ -28,6 +28,7 @@ from project.rh.forms import ContratForm, AyantDroitForm, EmployeAdminForm, \
         AjaxSelect, DossierForm, ResponsableInlineForm
 from project.rh.change_list import ChangeList
 
+
 def listing_par_defaut(model, request):
     """
     Teste si la requete provient de la même page.
@@ -42,6 +43,7 @@ def listing_par_defaut(model, request):
             model.__name__.lower(),)
     return referer != reverse(change_list_view)
 
+
 class BaseAdmin(admin.ModelAdmin):
 
     class Media:
@@ -152,7 +154,8 @@ class ProtectRegionMixin(object):
                 prefix_za = "%s__code__exact" % self.model.prefix_implantation
                 params.update({prefix_za: za})
                 request.GET = params
-        return super(ProtectRegionMixin, self).changelist_view(request, extra_context)
+        return super(ProtectRegionMixin, self) \
+                .changelist_view(request, extra_context)
 
     def queryset(self, request):
         qs = super(ProtectRegionMixin, self).queryset(request)
@@ -514,7 +517,8 @@ class DossierAdmin(DateRangeMixin, ProtectRegionMixin, reversion.VersionAdmin,
     def _zone_administrative(self, obj):
         return obj.poste.implantation.zone_administrative.code
     _zone_administrative.short_description = u"Zone administrative"
-    _zone_administrative.admin_order_field = 'poste__implantation__zone_administrative__code'
+    _zone_administrative.admin_order_field = \
+            'poste__implantation__zone_administrative__code'
 
     def _implantation(self, obj):
         return obj.poste.implantation.nom
@@ -901,10 +905,11 @@ class PosteAdmin(DateRangeMixin, ProtectRegionMixin, reversion.VersionAdmin,
     def lookup_allowed(self, key, value):
         return key in (
             'date_debut__gte', 'date_debut__isnull', 'date_fin__lte',
-            'date_fin__isnull', 'implantation__zone_administrative__code__exact',
+            'date_fin__isnull',
+            'implantation__zone_administrative__code__exact',
             'implantation__id__exact', 'type_poste__id__exact',
             'type_poste__categorie_emploi__id__exact', 'service__id__exact',
-            'service__isnull', 'vacant__exact', 'vacant__isnull',
+            'service__isnull', 'vacant__exact', 'vacant__isnull'
         ) or super(PosteAdmin, self).lookup_allowed(key, value)
 
     def _id(self, obj):
@@ -960,7 +965,8 @@ class PosteAdmin(DateRangeMixin, ProtectRegionMixin, reversion.VersionAdmin,
     def _zone_administrative(self, poste):
         return poste.implantation.zone_administrative.code
     _zone_administrative.short_description = 'Zone administrative'
-    _zone_administrative.admin_order_field = 'implantation__zone_administrative__code'
+    _zone_administrative.admin_order_field = \
+            'implantation__zone_administrative__code'
 
     def _implantation(self, poste):
         return poste.implantation.nom
@@ -1085,7 +1091,10 @@ class ResponsableImplantationAdmin(BaseAdmin):
         try:
             employe = employe = obj.responsable.employe
         except Exception, e:
-            return u"<span style='color: red;'>Pas de responsable</span><!-- %s -->" % e
+            return (
+                u"<span style='color: red;'>"
+                u"Pas de responsable</span><!-- %s -->" % e
+            )
         try:
             dossiers = employe.dossiers_encours()
             if len(dossiers) == 0: