I can use PickleCol in "brute force" mode, but not in "native dict
mode".  Here's my toy program:


# # ## ### ##### ######## ############# #####################

from sqlobject import SQLObject, PickleCol, StringCol
import sys

__connection__ = "sqlite:///home/cmd/tg/test.sqlite?debug=1"

class Test(SQLObject):
    test = PickleCol(default=None)

Test.createTable(ifNotExists=True)
t = Test()
t.test = {'foo': 'bar'}  # This is fine, the sqlite row is filled
t = Test.get(1)          
print t.test             # Also fine
t.test['baz'] = 'mumble'
print t.test             # This is fine
                         # But the row isn't updated in sqlite!

# If at first you don't succeed, force it:
import copy
scratch = copy.copy(t.test)
scratch['baz'] = 'mumble'
t.test = scratch         # now I can see the row in sqlite.


What am I missing?


-- 
Christopher DeMarco <[EMAIL PROTECTED]>
Alephant Systems (http://alephant.net)
PGP public key at http://pgp.alephant.net
+1-412-708-9660

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to