Since the database layer is advertised as coming essentially from TG I
thought I would pass this on from the the SA group.  I've not taken a
look at the code but I might take a stab at porting this over to pylons,
since I would defiantly use it in my next project
Jose

-------- Original Message --------
Subject:        [Sqlalchemy-users] TurboGears SA 0.2 support
Date:   Thu, 29 Jun 2006 09:29:47 -0400
From:   Kevin Dangoor <[EMAIL PROTECTED]>
To:     sqlalchemy-users <[email protected]>



BTW, if anyone wants to take a look at what I've done to support SA in
TurboGears, it's here:

http://trac.turbogears.org/turbogears/browser/branches/1.0/turbogears/database.py

Probably easier to read for many would be the tests:
http://trac.turbogears.org/turbogears/browser/branches/1.0/turbogears/tests/test_sqlalchemy.py

It's not a lot of code, which is a good thing :)

In TurboGears, transactions are implicit. If there's no error, a
transaction is committed at the end of the request. When used with
ActiveMapper, you get code that's quite similar to SQLObject (which is
why there's a hope for a compatibility layer):

class MyRoot(RootController):

    @expose()
    def no_error(self, name):
        p = Person(name=name)
        raise redirect("/confirm")

This creates a new Person and adds it to the database when you go to
/no_error passing in a name.

Kevin

-- 
Kevin Dangoor
TurboGears / Zesty News

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to