I tried posting this earlier and it didn't 'take'. Here's my 2nd
attempt:

I successfully applied the patch suggested by Dennis Muhlestein and
would like to officially thank him and Alberto for their help.
THANKS!!!

For anyone who follows, here's the patch in a nutshell, (as I applied
it):

All code is in the database.py module of turbogears.
1. add import:
from turbogears.genericfunctions import MultiorderGenericFunction

2. change the following as indicated by the comment (old one commented
out):
#[dispatch.generic()]
[dispatch.generic(MultiorderGenericFunction)]
def run_with_transaction(func, *args, **kw):
    pass

3. add the following below this:
from turbogears.decorator import weak_signature_decorator
def no_transaction():
    def wrap(func):
        def no_trans(func,*args,**kw):
            cherrypy.request._no_trans=True
            return func(*args,**kw)
        return no_trans
    return weak_signature_decorator(wrap)

def is_no_trans():
    return getattr(cherrypy.request,'_no_trans',False)

@run_with_transaction.when("is_no_trans()",order=-1)
def _no_trans_for_this_method(func, *args, **kw):
    log.debug ( "No Trans Method" )
    return func(*args, **kw)

4. in your controller, if you want to control the transaction
yourself, do this:
    @turbogears.database.no_transaction()
    @tg.expose()
    def my_controller_method( ... ):
        # create transactions, commit, rollback, etc. - all without
interference from TG.

Thanks again.
Joel


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