[sqlalchemy] Question PickledType usage

2013-03-12 Thread Zoltan Giber
Hi, I'm new to sqlalchemy, writing my first app using it. I stumbled upon a weird thing; my user object has a pyckletype representing a python dict, which i can't find a way to update. I assumed, that a change in the pickled object will somehow trigger dirty and my new data should be there,

Re: [sqlalchemy] Question PickledType usage

2013-03-12 Thread Matthew Desmarais
Hi Zoltan, On Tue, Mar 12, 2013 at 9:56 AM, Zoltan Giber zgi...@gmail.com wrote: I'm new to sqlalchemy, writing my first app using it. I stumbled upon a weird thing; my user object has a pyckletype representing a python dict, which i can't find a way to update. I assumed, that a change in

Re: [sqlalchemy] Question PickledType usage

2013-03-12 Thread Zoltan Giber
Thanks Matthew, I see that this would be a way, but I'm not very experienced, and introducing a new custom type feels like an overkill. I only have three pickletype in my whole app, and i don't mind to set dirty manually when I update them. I don't want to query against their values either.

Re: [sqlalchemy] Question PickledType usage

2013-03-12 Thread Michael Bayer
if you want to do this manually, just reassign to the attribute which will trigger it: myobject.mypickle = {dictionary} the mutation thing is only if you want in-place tracking, that is: myobject.mypickle['newvalue'] = 'something' On Mar 12, 2013, at 11:15 AM, Zoltan Giber zgi...@gmail.com

Re: [sqlalchemy] Question PickledType usage

2013-03-12 Thread Zoltan Giber
Thanks Michael, that did the trick. Using the mutable thing is only a small comfort in my case compared to the extra design it takes. for the sake of completeness here is what works: newuser = User(email,name,password) newuser.notebooks.append(Notebook(My Notes))