From 734e1e0c641fe6f993c70c156b376f311916ff2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Larchev=C3=AAque?= Date: Wed, 29 Feb 2012 15:40:57 -0500 Subject: [PATCH] devise manager --- project/rh/admin.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/project/rh/admin.py b/project/rh/admin.py index eb33baa..33d79be 100644 --- a/project/rh/admin.py +++ b/project/rh/admin.py @@ -208,7 +208,7 @@ class CommentaireAdmin(admin.ModelAdmin): class DeviseAdmin(AUFMetadataAdminMixin, admin.ModelAdmin): - list_display = ('code', 'nom', '_date_modification', 'user_modification',) + list_display = ('code', 'nom', '_archive', '_date_modification', 'user_modification',) list_filter = ('archive', ) fieldsets = AUFMetadataAdminMixin.fieldsets + ( (None, { @@ -216,6 +216,16 @@ class DeviseAdmin(AUFMetadataAdminMixin, admin.ModelAdmin): }), ) + def queryset(self, request): + return self.model._base_manager + + def _archive(self, obj): + if obj.archive: + return "oui" + else: + return "non" + _archive.short_description = u'Archivé' + def _date_modification(self, obj): return date(obj.date_modification) if obj.date_modification is not None else "(aucune)" _date_modification.short_description = u'date modification' -- 1.7.10.4