python an sqlite objects

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Thu Dec 4 14:26:02 CET 2008

skip at a écrit :
>     Bruno> If you serialize a dict, you'll obviously get a dict back. Note
>     Bruno> that the point of json is *not* to replace pickle. json is a
>     Bruno> *data* serialization format meant to represent "basic" types
>     Bruno> (dicts, lists, strings and numbers) in human readable and
>     Bruno> (mostly) language-agnostic way. 
> Right, which makes it unsuitable as a general object serialization format.

which makes it unsuitable as a full-fledged generic Python serialization 
format, at least OOTB (Django knows how to get model objects back from 
json, and I think one could write a more generic json serializer / 
deserializer with about the same limitations as pickle).

> The OP was unclear what he meant when he asked about storing Python objects
> in a sqlite database.  In the general case json doesn't cut it.

I indeed assumed (possibly wrongly) that this would be enough, given the 
use of a relational database. But as I said:

>     Bruno> If you want a Python object store, you'll be better looking at
>     Bruno> ZODB, Durus or friends.  --
> Or SQLAlchemy or SQLObject.

Not the same thing.

More information about the Python-list mailing list