本文整理汇总了Python中south.models.MigrationHistory.for_migration方法的典型用法代码示例。如果您正苦于以下问题:Python MigrationHistory.for_migration方法的具体用法?Python MigrationHistory.for_migration怎么用?Python MigrationHistory.for_migration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类south.models.MigrationHistory
的用法示例。
在下文中一共展示了MigrationHistory.for_migration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: record
# 需要导入模块: from south.models import MigrationHistory [as 别名]
# 或者: from south.models.MigrationHistory import for_migration [as 别名]
def record(migration, database):
# Record us as having not done this
record = MigrationHistory.for_migration(migration, database)
if record.id is not None:
if database != DEFAULT_DB_ALIAS:
record.delete(using=database)
else:
# Django 1.1 always goes down here
record.delete()
示例2: record
# 需要导入模块: from south.models import MigrationHistory [as 别名]
# 或者: from south.models.MigrationHistory import for_migration [as 别名]
def record(migration, database):
# Record us as having done this
record = MigrationHistory.for_migration(migration, database)
record.applied = datetime.datetime.utcnow()
if database != DEFAULT_DB_ALIAS:
record.save(using=database)
else:
# Django 1.1 and below always go down this branch.
record.save()
示例3: record
# 需要导入模块: from south.models import MigrationHistory [as 别名]
# 或者: from south.models.MigrationHistory import for_migration [as 别名]
def record(migration):
# Record us as having not done this
record = MigrationHistory.for_migration(migration)
if record.id is not None:
record.delete()
示例4: record
# 需要导入模块: from south.models import MigrationHistory [as 别名]
# 或者: from south.models.MigrationHistory import for_migration [as 别名]
def record(app_name, migration):
# Record us as having not done this
record = MigrationHistory.for_migration(app_name, migration)
record.delete()