From 6264f55c6bac201a99412df1b14b4db7937e7923 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Wed, 5 Mar 2014 22:49:32 +0400 Subject: [PATCH] =?UTF-8?q?chercher=20d'abord=20une=20m=C3=A9thode=20appel?= =?UTF-8?q?=C3=A9e=20index?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyulib/src/ulib/web/pages.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyulib/src/ulib/web/pages.py b/pyulib/src/ulib/web/pages.py index 8ba5162..ce12ceb 100644 --- a/pyulib/src/ulib/web/pages.py +++ b/pyulib/src/ulib/web/pages.py @@ -245,8 +245,11 @@ class Page(object): def __response(self, name, method): self.NAME = name self.METHOD = method - if not name: name = self.__class__.__name__ - m = getattr(self, name, None) + m = None + if m is None and hasattr(self, 'index'): + m = getattr(self, 'index') + if m is None and hasattr(self, self.__class__.__name__): + m = getattr(self, self.__class__.__name__) if m is None: m = self.error # XXX Ajouter un argument en fonction de la valeur du header Accept:, pour text/plain, # text/html, application/xml et application/xhtml+xml