You could annotate the request with some other property (request.called_foo
= True) and check if getattr(request, 'called_foo') in the tween.

However, if you're okay relying on an implementation detail of reify then
the following works:

class Foo(object):
    @reify
    def bar(self):
        return 42

foo = Foo()
print 'bar' in foo.__dict__ # -> False
foo.bar
print 'bar' in foo.__dict__ # -> True



On Thu, Apr 17, 2014 at 2:57 PM, wilk <[email protected]> wrote:

>
> Hi,
>
> For db connexion I use add_request_method with reify=True.
> In the end I commit only if this method was called.
>
> Now I use a tween and record the fact that the connexion was used or
> not, it's not a problem but I wonder if there is a way to directly know
> if a method was called (and reified) or not ?
>
> thanks
>
> --
> William
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pylons-discuss.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to