avdd wrote:
> On Feb 2, 2:52 am, "Michael Bayer" wrote:
>
>> the behavior you first illustrated, that of merge() and add() not acting
>> the same regarding pending changes, was a behavior that was somewhat in
>> the realm of a bug. I mentioned the other day it was fixed in r6711.
>
> Well no,
On Feb 2, 2:52 am, "Michael Bayer" wrote:
> the behavior you first illustrated, that of merge() and add() not acting
> the same regarding pending changes, was a behavior that was somewhat in
> the realm of a bug. I mentioned the other day it was fixed in r6711.
Well no, not in 0.5 (r6712).
avdd wrote:
> So I get around this by essentially doing:
>
> # called on every request
> def refresh_model(context, obj):
> context.get_db().add(obj)
>
> def store_model(context, obj):
> db = object_session(obj)
> if db:
> db.expunge(obj)
> obj = db.merge(obj)
> db.flush
So I get around this by essentially doing:
# called on every request
def refresh_model(context, obj):
context.get_db().add(obj)
def store_model(context, obj):
db = object_session(obj)
if db:
db.expunge(obj)
obj = db.merge(obj)
db.flush()
return obj
Which seems to
On Jan 31, 4:33 am, Michael Bayer wrote:
> this example is too compliated for me to understand without great effort,
> perhaps someone else has the time to follow it more closely - it appears to
> be creating and closing many new sessions and add()ing objects between them -
> an unusual series