On Dec 12, 2006, at 3:11 PM, Dennis Muhlestein wrote:

>
>
>>
>> Hmmm, this makes me wonder... have you tried:
>>
>> def _check_no_trans(func):
>>     return getattr(func_original(func), '_no_trans', False) and  
>> _use_sa()
>>
>> @run_with_transaction("_check_no_trans(func)")
>> def sadsadfsdf(....):
>>     .....
> That approach has the same problem.
>
> Well, I tried this:
> @run_with_transaction("_use_sa() and True")
> ...
>
> and it works.
>
> So the problem is definitely in the checking for the _no_trans
> attribute and not in the dispatch code.
>
> Next, I'm going to play around with different versions of the  
> decorator
> for setting the _no_trans.  See, I'm using multiple decorators in my
> code:
>
> @expose()
> @error_handler(...)
> @validate(...)
> def ...
>
> So I think the problem is that func_original probably may not be
> returning the _real_ original function.  I haven't looked at that a  
> lot
> yet but I suspect that is the problem.

This is precisely why I'd like to replace the decorators with some  
other kind of marker for TG 2.0.

Note that another approach would be to put your _no_trans on  
cherrypy.request.

Kevin


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to