i never had to do this before.
some sample code is below; basically in a function i need to 'expire'
some looped items , so i pull fresh from the db.
my problem is that i don't know how to access the db from within the
model ; i could pass-it-in explicitly from the controller... but i'd
really like to fetch whatever dbhandle the object was retreived with
controller:
jonathan= dbSession.query( model.person ).filter( id=1 )
model:
class person(object):
def fun(self):
for item in self.items:
db.expire( item ) # what is the db here? was it
associated within dbSession.query() ?
--
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?hl=en.