当前位置: 首页>>代码示例>>Python>>正文


Python MigrationHistory.for_migration方法代码示例

本文整理汇总了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()
开发者ID:RaD,项目名称:django-south,代码行数:11,代码来源:migrators.py

示例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()
开发者ID:NikitaVAP,项目名称:pycdb,代码行数:11,代码来源:migrators.py

示例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()
开发者ID:notanumber,项目名称:south,代码行数:7,代码来源:migrators.py

示例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()
开发者ID:fdl06,项目名称:medianav,代码行数:6,代码来源:migration.py


注:本文中的south.models.MigrationHistory.for_migration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。