/
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
sqlalchemy
/
orm
/
/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm
mkdir
upload
Name
Size
Mode
Actions
attributes.py
67137
0644
edit
dl
rm
attributes.pyc
62129
0644
edit
dl
rm
attributes.pyo
61851
0644
edit
dl
rm
base.py
14864
0644
edit
dl
rm
base.pyc
15558
0644
edit
dl
rm
base.pyo
15558
0644
edit
dl
rm
collections.py
52614
0644
edit
dl
rm
collections.pyc
63448
0644
edit
dl
rm
collections.pyo
63226
0644
edit
dl
rm
dependency.py
46556
0644
edit
dl
rm
dependency.pyc
29624
0644
edit
dl
rm
dependency.pyo
29533
0644
edit
dl
rm
deprecated_interfaces.py
20751
0644
edit
dl
rm
deprecated_interfaces.pyc
22776
0644
edit
dl
rm
deprecated_interfaces.pyo
22776
0644
edit
dl
rm
descriptor_props.py
28201
0644
edit
dl
rm
descriptor_props.pyc
32216
0644
edit
dl
rm
descriptor_props.pyo
32216
0644
edit
dl
rm
dynamic.py
14666
0644
edit
dl
rm
dynamic.pyc
15339
0644
edit
dl
rm
dynamic.pyo
15339
0644
edit
dl
rm
evaluator.py
5441
0644
edit
dl
rm
evaluator.pyc
7819
0644
edit
dl
rm
evaluator.pyo
7819
0644
edit
dl
rm
events.py
94409
0644
edit
dl
rm
events.pyc
103665
0644
edit
dl
rm
events.pyo
103665
0644
edit
dl
rm
exc.py
6610
0644
edit
dl
rm
exc.pyc
8838
0644
edit
dl
rm
exc.pyo
8838
0644
edit
dl
rm
identity.py
10299
0644
edit
dl
rm
identity.pyc
15109
0644
edit
dl
rm
identity.pyo
15109
0644
edit
dl
rm
instrumentation.py
18131
0644
edit
dl
rm
instrumentation.pyc
21633
0644
edit
dl
rm
instrumentation.pyo
21544
0644
edit
dl
rm
interfaces.py
25766
0644
edit
dl
rm
interfaces.pyc
30234
0644
edit
dl
rm
interfaces.pyo
30234
0644
edit
dl
rm
loading.py
32236
0644
edit
dl
rm
loading.pyc
20574
0644
edit
dl
rm
loading.pyo
20549
0644
edit
dl
rm
mapper.py
128344
0644
edit
dl
rm
mapper.pyc
100412
0644
edit
dl
rm
mapper.pyo
100198
0644
edit
dl
rm
path_registry.py
9262
0644
edit
dl
rm
path_registry.pyc
13256
0644
edit
dl
rm
path_registry.pyo
13256
0644
edit
dl
rm
persistence.py
65652
0644
edit
dl
rm
persistence.pyc
46786
0644
edit
dl
rm
persistence.pyo
46786
0644
edit
dl
rm
properties.py
11043
0644
edit
dl
rm
properties.pyc
12111
0644
edit
dl
rm
properties.pyo
12111
0644
edit
dl
rm
query.py
172590
0644
edit
dl
rm
query.pyc
155014
0644
edit
dl
rm
query.pyo
154936
0644
edit
dl
rm
relationships.py
124442
0644
edit
dl
rm
relationships.pyc
105318
0644
edit
dl
rm
relationships.pyo
105293
0644
edit
dl
rm
scoping.py
6393
0644
edit
dl
rm
scoping.pyc
7680
0644
edit
dl
rm
scoping.pyo
7680
0644
edit
dl
rm
session.py
128754
0644
edit
dl
rm
session.pyc
120117
0644
edit
dl
rm
session.pyo
119938
0644
edit
dl
rm
state.py
31044
0644
edit
dl
rm
state.pyc
32294
0644
edit
dl
rm
state.pyo
32238
0644
edit
dl
rm
strategies.py
84602
0644
edit
dl
rm
strategies.pyc
63019
0644
edit
dl
rm
strategies.pyo
62668
0644
edit
dl
rm
strategy_options.py
55505
0644
edit
dl
rm
strategy_options.pyc
52730
0644
edit
dl
rm
strategy_options.pyo
52596
0644
edit
dl
rm
sync.py
5536
0644
edit
dl
rm
sync.pyc
4628
0644
edit
dl
rm
sync.pyo
4628
0644
edit
dl
rm
unitofwork.py
24735
0644
edit
dl
rm
unitofwork.pyc
24565
0644
edit
dl
rm
unitofwork.pyo
24489
0644
edit
dl
rm
util.py
44859
0644
edit
dl
rm
util.pyc
44363
0644
edit
dl
rm
util.pyo
44211
0644
edit
dl
rm
__init__.py
9542
0644
edit
dl
rm
__init__.pyc
10759
0644
edit
dl
rm
__init__.pyo
10759
0644
edit
dl
rm
Edit:
/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/sync.py
(5536B)
# orm/sync.py # Copyright (C) 2005-2019 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """private module containing functions used for copying data between instances based on join conditions. """ from . import attributes from . import exc from . import util as orm_util def populate( source, source_mapper, dest, dest_mapper, synchronize_pairs, uowcommit, flag_cascaded_pks, ): source_dict = source.dict dest_dict = dest.dict for l, r in synchronize_pairs: try: # inline of source_mapper._get_state_attr_by_column prop = source_mapper._columntoproperty[l] value = source.manager[prop.key].impl.get( source, source_dict, attributes.PASSIVE_OFF ) except exc.UnmappedColumnError: _raise_col_to_prop(False, source_mapper, l, dest_mapper, r) try: # inline of dest_mapper._set_state_attr_by_column prop = dest_mapper._columntoproperty[r] dest.manager[prop.key].impl.set(dest, dest_dict, value, None) except exc.UnmappedColumnError: _raise_col_to_prop(True, source_mapper, l, dest_mapper, r) # technically the "r.primary_key" check isn't # needed here, but we check for this condition to limit # how often this logic is invoked for memory/performance # reasons, since we only need this info for a primary key # destination. if ( flag_cascaded_pks and l.primary_key and r.primary_key and r.references(l) ): uowcommit.attributes[("pk_cascaded", dest, r)] = True def bulk_populate_inherit_keys(source_dict, source_mapper, synchronize_pairs): # a simplified version of populate() used by bulk insert mode for l, r in synchronize_pairs: try: prop = source_mapper._columntoproperty[l] value = source_dict[prop.key] except exc.UnmappedColumnError: _raise_col_to_prop(False, source_mapper, l, source_mapper, r) try: prop = source_mapper._columntoproperty[r] source_dict[prop.key] = value except exc.UnmappedColumnError: _raise_col_to_prop(True, source_mapper, l, source_mapper, r) def clear(dest, dest_mapper, synchronize_pairs): for l, r in synchronize_pairs: if ( r.primary_key and dest_mapper._get_state_attr_by_column(dest, dest.dict, r) not in orm_util._none_set ): raise AssertionError( "Dependency rule tried to blank-out primary key " "column '%s' on instance '%s'" % (r, orm_util.state_str(dest)) ) try: dest_mapper._set_state_attr_by_column(dest, dest.dict, r, None) except exc.UnmappedColumnError: _raise_col_to_prop(True, None, l, dest_mapper, r) def update(source, source_mapper, dest, old_prefix, synchronize_pairs): for l, r in synchronize_pairs: try: oldvalue = source_mapper._get_committed_attr_by_column( source.obj(), l ) value = source_mapper._get_state_attr_by_column( source, source.dict, l, passive=attributes.PASSIVE_OFF ) except exc.UnmappedColumnError: _raise_col_to_prop(False, source_mapper, l, None, r) dest[r.key] = value dest[old_prefix + r.key] = oldvalue def populate_dict(source, source_mapper, dict_, synchronize_pairs): for l, r in synchronize_pairs: try: value = source_mapper._get_state_attr_by_column( source, source.dict, l, passive=attributes.PASSIVE_OFF ) except exc.UnmappedColumnError: _raise_col_to_prop(False, source_mapper, l, None, r) dict_[r.key] = value def source_modified(uowcommit, source, source_mapper, synchronize_pairs): """return true if the source object has changes from an old to a new value on the given synchronize pairs """ for l, r in synchronize_pairs: try: prop = source_mapper._columntoproperty[l] except exc.UnmappedColumnError: _raise_col_to_prop(False, source_mapper, l, None, r) history = uowcommit.get_attribute_history( source, prop.key, attributes.PASSIVE_NO_INITIALIZE ) if bool(history.deleted): return True else: return False def _raise_col_to_prop( isdest, source_mapper, source_column, dest_mapper, dest_column ): if isdest: raise exc.UnmappedColumnError( "Can't execute sync rule for " "destination column '%s'; mapper '%s' does not map " "this column. Try using an explicit `foreign_keys` " "collection which does not include this column (or use " "a viewonly=True relation)." % (dest_column, dest_mapper) ) else: raise exc.UnmappedColumnError( "Can't execute sync rule for " "source column '%s'; mapper '%s' does not map this " "column. Try using an explicit `foreign_keys` " "collection which does not include destination column " "'%s' (or use a viewonly=True relation)." % (source_column, source_mapper, dest_column) )
Save
cmd:
run