# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1242649346 -7200 # Node ID c7a22540d6f7e0c3ab75e002172c44c2846d7785 # Parent d629a6fc33e54cccd441cb530d7db80ed14fd799 add some bw compat code for old rest_path prototype diff -r d629a6fc33e5 -r c7a22540d6f7 entity.py --- a/entity.py Mon May 18 14:08:21 2009 +0200 +++ b/entity.py Mon May 18 14:22:26 2009 +0200 @@ -380,7 +380,12 @@ if getattr(self.req, 'search_state', ('normal',))[0] == 'normal': kwargs['base_url'] = self.metainformation()['source'].get('base-url') if method is None or method == 'view': - kwargs['_restpath'] = self.rest_path(kwargs.get('base_url')) + try: + kwargs['_restpath'] = self.rest_path(kwargs.get('base_url')) + except TypeError: + warn('%s: rest_path() now take use_ext_eid argument, ' + 'please update' % self.id, DeprecationWarning) + kwargs['_restpath'] = self.rest_path() else: kwargs['rql'] = 'Any X WHERE X eid %s' % self.eid return self.build_url(method, **kwargs)