本文整理汇总了Python中sqlalchemy.orm.sync.source_modified函数的典型用法代码示例。如果您正苦于以下问题:Python source_modified函数的具体用法?Python source_modified怎么用?Python source_modified使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了source_modified函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_source_modified_unmodified
def test_source_modified_unmodified(self):
uowcommit, a1, b1, a_mapper, b_mapper = self._fixture()
a1.obj().id = 10
pairs = [(a_mapper.c.id, b_mapper.c.id,)]
eq_(
sync.source_modified(uowcommit, a1, a_mapper, pairs),
False
)
示例2: test_source_modified_modified
def test_source_modified_modified(self):
uowcommit, a1, b1, a_mapper, b_mapper = self._fixture()
a1.obj().id = 10
a1.commit_all(a1.dict)
a1.obj().id = 12
pairs = [(a_mapper.c.id, b_mapper.c.id,)]
eq_(
sync.source_modified(uowcommit, a1, a_mapper, pairs),
True
)
示例3: test_source_modified_composite_unmodified
def test_source_modified_composite_unmodified(self):
uowcommit, a1, b1, a_mapper, b_mapper = self._fixture()
a1.obj().foo = 10
a1._commit_all(a1.dict)
pairs = [(a_mapper.c.id, b_mapper.c.id,),
(a_mapper.c.foo, b_mapper.c.id)]
eq_(
sync.source_modified(uowcommit, a1, a_mapper, pairs),
False
)
示例4: _pks_changed
def _pks_changed(self, uowcommit, state):
return bool(state.key) and sync.source_modified(uowcommit,
state,
self.mapper,
self.prop.synchronize_pairs)
示例5: test_source_modified_no_pairs
def test_source_modified_no_pairs(self):
uowcommit, a1, b1, a_mapper, b_mapper = self._fixture()
eq_(
sync.source_modified(uowcommit, a1, a_mapper, []),
False
)
示例6: _pks_changed
def _pks_changed(self, uowcommit, state):
return state.has_identity and sync.source_modified(uowcommit,
state,
self.mapper,
self.prop.synchronize_pairs)