Excellent, that (expire, refresh) works. Thank-you very much.
Is there a reason why it sometimes works?
On Feb 20, 11:47 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
On Feb 20, 2007, at 12:01 PM, Ali wrote:
u = User(name='Ali')
u.flush()
r = Receipt(user_id=u.id)
r.flush()
r.user is u
True
r.cancelled_user_id = u.id
r.flush()
r.cancelled_user is u
True
oh sorry, i missed this one. when you say "r.cancelled_user_id =
u.id", that will send the right SQL to the database but isnt going to
change the "r.cancelled_user" property to anything unless you refresh
()/expire() the Receipt object.
references:
http://www.sqlalchemy.org/docs/
unitofwork.myt#unitofwork_api_flush_whatishttp://www.sqlalchemy.org/trac/wiki/
FAQ#Isetthefoo_idattributeonmyinstanceto7butthefooattributeisstillNonesh
ouldntithaveloadedFoowithid7