On Wednesday 24 September 2008 10:47:40 Kirk Strauser wrote:

> In this situation, I have no idea what happens with the SQLite settings I
> configured in dev.cfg, whether they were replaced or somehow augmented so
> that both databases are now bound to the session.
>
> I just wanted to follow up with this to warn future Googlers about the
> unexpected results.

I think I'm about to give up on the idea of TurboGears + SQLAlchemy.  I don't 
know why the following isn't flushing changes out to our database even though I 
use almost identical code outside TG in other applications all the time.  
Here, 'Types.py' is a module containing nothing but SA table and mapper 
definitions.

    @expose(template='lite.templates.backoffice.shipmentdetail')
    def updatedeliveryinfo(self, **args):
        shipinfo = session.query(Types.Ship).filter_by(shipid=args['shipid'])
        shipinfo = shipinfo.join(['BofReg', 'XrsCust'])
        shipinfo = 
shipinfo.filter(Types.XrsCust.xrsgrpcd==identity.current.user.groupcode).one()
        shipinfo.destincd = 'HI CAN HAZ IT'
        session.commit()
        flash('updated %s' % shipinfo.destincd)
        redirect('shipmentdetail/%s' % args['shipid'])

So I'm updating an object's property and committing the session, but it has 
the old value when I load the next page (and verified by querying the table 
directly via psql in a terminal window).  Throw a rope to a drowning man?
-- 
Kirk Strauser

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