From 014377038491b412d72ca19815b8dd7696e76b2a Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Thu, 9 Apr 2009 22:57:16 +0000 Subject: [PATCH] Corrected duplication of serializer docs. Fixes #1375. --- doc/build/reference/ext/serializer.rst | 36 -------------------------- 1 file changed, 36 deletions(-) diff --git a/doc/build/reference/ext/serializer.rst b/doc/build/reference/ext/serializer.rst index 184e57f1bd..759ba35ce6 100644 --- a/doc/build/reference/ext/serializer.rst +++ b/doc/build/reference/ext/serializer.rst @@ -3,42 +3,6 @@ serializer :author: Mike Bayer -Serializer/Deserializer objects for usage with SQLAlchemy structures. - -Any SQLAlchemy structure, including Tables, Columns, expressions, mappers, -Query objects etc. can be serialized in a minimally-sized format, -and deserialized when given a Metadata and optional ScopedSession object -to use as context on the way out. - -Usage is nearly the same as that of the standard Python pickle module: - -.. sourcecode:: python+sql - - from sqlalchemy.ext.serializer import loads, dumps - metadata = MetaData(bind=some_engine) - Session = scoped_session(sessionmaker()) - - # ... define mappers - - query = Session.query(MyClass).filter(MyClass.somedata=='foo').order_by(MyClass.sortkey) - - # pickle the query - serialized = dumps(query) - - # unpickle. Pass in metadata + scoped_session - query2 = loads(serialized, metadata, Session) - - print query2.all() - -Similar restrictions as when using raw pickle apply; mapped classes must be -themselves be pickleable, meaning they are importable from a module-level -namespace. - -Note that instances of user-defined classes do not require this extension -in order to be pickled; these contain no references to engines, sessions -or expression constructs in the typical case and can be serialized directly. -This module is specifically for ORM and expression constructs. - .. automodule:: sqlalchemy.ext.serializer :members: :undoc-members: -- 2.47.2