I apologize if a response to this comes twice.  The first one didn't
appear to send.

> work. Have you tried swapping the predicates?
>
> """_use_sa() and getattr(func,"_no_trans",False)"""

That didn't seem to affect anything.  I also put a log statement in the
condition and turned the logging level to debug.  I noticed that
conditions seem to be evaluated at load time.  I thought then that
perhaps the _no_trans attribute is not being set until after the
condition is evaluated:

example:
@expose()
def something(self):
 pass
something._no_trans=True

is the same as
def something(self):
 pass
expose()(something)
something._no_trans=True


So I changed my code to be this:

def something(self):
 pass
something._no_trans=True
expose()(something)

Unfortunately, the effect was the same and the sa_rwt method is still
called.

>
> If that still doesn't make it, fortunately, as you've noticed, TG has
> the infrastruture to handle the "order" argument to the
> GenericFunction decorators. You'll need to patch
> database.run_with_transaction so it looks like this:
>
> from turbogears.genericfunctions import MultiorderGenericFunction
>
> @generic(MultiorderGenericFunction)
> def run_with_transaction(....)
>
> You'll need to set the order to -1 so it runs before the default
> which is 0.
>

I tried patching TG for the MultiorderGenericFunction in combination
with the change I mentioned above and the sa_rwt method is still
called.  I'm a little stumpted at this point.  The condition is indeed
being evaluated (I checked that with the logging) but I haven't been
able to figure out what I need to change to get run_with_transaction to
call my no_trans method instead of sa_rwt.

Suggestions?

Thanks
Dennis


--~--~---------~--~----~------------~-------~--~----~
 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