本文整理汇总了Python中alembic.script.revision.RevisionMap.filter_for_lineage方法的典型用法代码示例。如果您正苦于以下问题:Python RevisionMap.filter_for_lineage方法的具体用法?Python RevisionMap.filter_for_lineage怎么用?Python RevisionMap.filter_for_lineage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类alembic.script.revision.RevisionMap
的用法示例。
在下文中一共展示了RevisionMap.filter_for_lineage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_filter_for_lineage_labeled_head_across_merge
# 需要导入模块: from alembic.script.revision import RevisionMap [as 别名]
# 或者: from alembic.script.revision.RevisionMap import filter_for_lineage [as 别名]
def test_filter_for_lineage_labeled_head_across_merge(self):
def fn():
return [
Revision("a", ()),
Revision("b", ("a",)),
Revision("c1", ("b",), branch_labels="c1branch"),
Revision("c2", ("b",)),
Revision("d", ("c1", "c2")),
]
map_ = RevisionMap(fn)
c1 = map_.get_revision("c1")
c2 = map_.get_revision("c2")
d = map_.get_revision("d")
eq_(map_.filter_for_lineage([c1, c2, d], "[email protected]"), [c1, c2, d])
示例2: test_filter_for_lineage_labeled_head_across_merge
# 需要导入模块: from alembic.script.revision import RevisionMap [as 别名]
# 或者: from alembic.script.revision.RevisionMap import filter_for_lineage [as 别名]
def test_filter_for_lineage_labeled_head_across_merge(self):
fn = lambda: [
Revision('a', ()),
Revision('b', ('a', )),
Revision('c1', ('b', ), branch_labels='c1branch'),
Revision('c2', ('b', )),
Revision('d', ('c1', 'c2')),
]
map_ = RevisionMap(fn)
c1 = map_.get_revision('c1')
c2 = map_.get_revision('c2')
d = map_.get_revision('d')
eq_(
map_.filter_for_lineage([c1, c2, d], "[email protected]"),
[c1, c2, d]
)