I noticed something kinda weird the other day.
Let's say I have an object 'o' with two fields: "num" (an integer) and
"nums" (an array of integers).

Using 'inspect' and some trickery:

>>> d = dict(sa.inspect(o).attrs)
>>> d['num'].history
History(added=(), unchanged=(10), deleted=())
>>> d['nums'].history
History(added=(), unchanged=[[20,30]], deleted=())

Now, if I change o.num to any other value, the history value changes
(as expected):

>>> o.num = 15
>>> d['num'].history
History(added=[15], unchanged=(), deleted=[10])

But if I change the array *using append/delete/etc*:

>>> o.nums.append(40)
>>> d['nums'].history
History(added=(), unchanged=[[20,30,40]], deleted=())

But if I change o.nums directly:
>>> o.nums = [ 40,50,60 ]
>>> d['nums'].history
History(added=[[40,50,60]], unchanged=(), deleted=[[20,30,40]])

and that seems weird.


-- 
Jon
Software Blacksmith

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to