/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext
NameSizeModeActions
declarative/-0755rm
associationproxy.py494630644editdlrm
associationproxy.pyc634560644editdlrm
associationproxy.pyo633810644editdlrm
automap.py417100644editdlrm
automap.pyc369150644editdlrm
automap.pyo369150644editdlrm
baked.py214690644editdlrm
baked.pyc248090644editdlrm
baked.pyo248090644editdlrm
compiler.py168500644editdlrm
compiler.pyc171090644editdlrm
compiler.pyo171090644editdlrm
horizontal_shard.py91090644editdlrm
horizontal_shard.pyc93740644editdlrm
horizontal_shard.pyo93350644editdlrm
hybrid.py402330644editdlrm
hybrid.pyc435660644editdlrm
hybrid.pyo435660644editdlrm
indexable.py111690644editdlrm
indexable.pyc114560644editdlrm
indexable.pyo114560644editdlrm
instrumentation.py143510644editdlrm
instrumentation.pyc176480644editdlrm
instrumentation.pyo176480644editdlrm
mutable.py318080644editdlrm
mutable.pyc391390644editdlrm
mutable.pyo391390644editdlrm
orderinglist.py138880644editdlrm
orderinglist.pyc163190644editdlrm
orderinglist.pyo163190644editdlrm
serializer.py57840644editdlrm
serializer.pyc60480644editdlrm
serializer.pyo60480644editdlrm
__init__.py3220644editdlrm
__init__.pyc2890644editdlrm
__init__.pyo2890644editdlrm
Edit: /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/serializer.pyc (6048B)
ó ÃÌ4]c@sCdZddlZddlmZddlmZddlmZddlmZddl m Z dd l m Z dd l mZdd lmZdd lmZdd lmZddlmZddlmZddlmZddddgZd„ZejdƒZdddd„Zejd„Zdddd„ZdS(sSerializer/Deserializer objects for usage with SQLAlchemy query structures, allowing "contextual" deserialization. Any SQLAlchemy query structure, either based on sqlalchemy.sql.* or sqlalchemy.orm.* can be used. The mappers, Tables, Columns, Session etc. which are referenced by the structure are not persisted in serialized form, but are instead re-associated with the query structure when it is deserialized. Usage is nearly the same as that of the standard Python pickle module:: 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. The serializer module is only appropriate for query structures. It is not needed for: * instances of user-defined classes. These contain no references to engines, sessions or expression constructs in the typical case and can be serialized directly. * Table metadata that is to be loaded entirely from the serialized structure (i.e. is not already declared in the application). Regular pickle.loads()/dumps() can be used to fully dump any ``MetaData`` object, typically one which was reflected from an existing database at some previous point in time. The serializer module is specifically for the opposite case, where the Table metadata is already present in memory. iÿÿÿÿNi(tColumn(tTable(tEngine(t class_mapper(tQueryableAttribute(tMapperProperty(tMapper(tSession(t b64decode(t b64encode(t byte_buffer(tpickle(t text_typet Serializert DeserializertdumpstloadscOs(tj||Ž}d„}||_|S(NcSstt|tƒrK|jj}|jj}d|dttj|ƒƒ}n%t|tƒrƒ|j rƒdttj|jƒƒ}nít|t ƒrÌ|j j rÌdttj|j jƒƒd|j}n¤t|t ƒrñdt |jƒ}nt|tƒr<t|jt ƒr<dt |jjƒdt |jƒ}n4t|tƒrTd}nt|tƒrld}ndS|S( Ns attribute:t:smapper:s mapperprop:stable:scolumn:ssession:sengine:(t isinstanceRtimpltclass_tkeyR R RRt non_primaryRtparentRR RttableRRtNone(tobjtclsRtid_((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/serializer.pyt persistent_idOs$  $-!*  (R tPicklerR(targstkwtpicklerR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/serializer.pyR Ls  s>(mapperprop|mapper|table|column|session|attribute|engine):(.*)csFtj|ƒ}‡‡‡fd†‰‡‡‡fd†}||_|S(NcsDˆr ˆSˆr&ˆƒjr&ˆƒjSˆr<ˆjr<ˆjSdSdS(N(tbindR((tenginetmetadatatscoped_session(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/serializer.pyt get_enginexs c sptjt|ƒƒ}|sdS|jddƒ\}}|dkrz|jdƒ\}}tjt|ƒƒ}t ||ƒS|dkr¥tjt|ƒƒ}t |ƒS|dkrì|jdƒ\}}tjt|ƒƒ}t |ƒj |S|dkrˆj |S|dkr6|jdƒ\} } ˆj | j | S|d krIˆƒS|d kr\ˆƒStd |ƒ‚dS( Niit attributeRtmappert mapperpropRtcolumntsessionR#sUnknown token: %s(tour_idstmatchR RtgrouptsplitR RRtgetattrRtattrsttablestct Exception( Rtmttype_RRtclsargRR(tkeynameRtcolname(R&R$R%(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/serializer.pytpersistent_load‚s2          (R t UnpicklerR:(tfileR$R%R#t unpicklerR:((R#R&R$R%sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/serializer.pyRus   cCs/tƒ}t||ƒ}|j|ƒ|jƒS(N(R R tdumptgetvalue(RtprotocoltbufR!((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/serializer.pyR£s  cCs+t|ƒ}t||||ƒ}|jƒS(N(R Rtload(tdataR$R%R#RAR=((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/serializer.pyRªs ( t__doc__tretRRR#RtormRtorm.attributesRtorm.interfacesRt orm.mapperRt orm.sessionRtutilRR R R R t__all__R tcompileR,RRtHIGHEST_PROTOCOLRR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/serializer.pyt6s*  $ .