tags:

views:

11

answers:

1

I've successfully pickled persistent instances freshly loaded from the DB, but I can't seem to do the same for an instance that I've just created, and is in session.new.

Getting the following error (the python pickle module had the more helpful version of the message):

*** PicklingError: Can't pickle <function <lambda> at 0xb08d3ac>: 
    it's not found as sqlalchemy.ext.associationproxy.<lambda>

If I clear the association_proxy by doing the following:

my_new_obj.my_proxy = []
del my_new_obj.my_proxy

my_new_obj pickles fine.

Any ideas how I can have my association_proxy and eat it too?

A: 

Might have found a solution here:

http://www.sqlalchemy.org/trac/ticket/1446

(solution is to upgrade)

EoghanM