本文整理汇总了Python中south.models.MigrationHistory类的典型用法代码示例。如果您正苦于以下问题:Python MigrationHistory类的具体用法?Python MigrationHistory怎么用?Python MigrationHistory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MigrationHistory类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: record
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,代码行数:9,代码来源:migrators.py
示例2: record
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,代码行数:9,代码来源:migrators.py
示例3: record
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,代码行数:5,代码来源:migrators.py
示例4: record
def record(app_name, migration):
# Record us as having not done this
record = MigrationHistory.for_migration(app_name, migration)
record.delete()
开发者ID:fdl06,项目名称:medianav,代码行数:4,代码来源:migration.py
示例5: import_data
def import_data():
#initial imports
#Processing model: Snippet
from caravana4site.models import Snippet
#Processing model: Units
from caravana4site.models import Units
#Processing model: ProductCategorie
from caravana4site.models import ProductCategorie
caravana4site_productcategorie_1 = ProductCategorie()
caravana4site_productcategorie_1.name = u'Ternera'
caravana4site_productcategorie_1 = importer.save_or_locate(caravana4site_productcategorie_1)
caravana4site_productcategorie_2 = ProductCategorie()
caravana4site_productcategorie_2.name = u'Pollo'
caravana4site_productcategorie_2 = importer.save_or_locate(caravana4site_productcategorie_2)
caravana4site_productcategorie_3 = ProductCategorie()
caravana4site_productcategorie_3.name = u'Novillos'
caravana4site_productcategorie_3 = importer.save_or_locate(caravana4site_productcategorie_3)
caravana4site_productcategorie_4 = ProductCategorie()
caravana4site_productcategorie_4.name = u'L\xe1cteos'
caravana4site_productcategorie_4 = importer.save_or_locate(caravana4site_productcategorie_4)
caravana4site_productcategorie_5 = ProductCategorie()
caravana4site_productcategorie_5.name = u'Menudencias'
caravana4site_productcategorie_5 = importer.save_or_locate(caravana4site_productcategorie_5)
caravana4site_productcategorie_6 = ProductCategorie()
caravana4site_productcategorie_6.name = u'Cerdos'
caravana4site_productcategorie_6 = importer.save_or_locate(caravana4site_productcategorie_6)
caravana4site_productcategorie_7 = ProductCategorie()
caravana4site_productcategorie_7.name = u'Corderos'
caravana4site_productcategorie_7 = importer.save_or_locate(caravana4site_productcategorie_7)
caravana4site_productcategorie_8 = ProductCategorie()
caravana4site_productcategorie_8.name = u'Chivitos'
caravana4site_productcategorie_8 = importer.save_or_locate(caravana4site_productcategorie_8)
caravana4site_productcategorie_9 = ProductCategorie()
caravana4site_productcategorie_9.name = u'Conejos'
caravana4site_productcategorie_9 = importer.save_or_locate(caravana4site_productcategorie_9)
caravana4site_productcategorie_10 = ProductCategorie()
caravana4site_productcategorie_10.name = u'Elaborados'
caravana4site_productcategorie_10 = importer.save_or_locate(caravana4site_productcategorie_10)
#Processing model: MigrationHistory
from south.models import MigrationHistory
south_migrationhistory_1 = MigrationHistory()
south_migrationhistory_1.app_name = u'caravana4site'
south_migrationhistory_1.migration = u'0001_initial'
south_migrationhistory_1.applied = dateutil.parser.parse("2014-01-02T01:51:38.318328+00:00")
south_migrationhistory_1 = importer.save_or_locate(south_migrationhistory_1)
south_migrationhistory_2 = MigrationHistory()
south_migrationhistory_2.app_name = u'caravana4site'
south_migrationhistory_2.migration = u'0002_auto__add_field_homecarouseloffert_start_date__add_field_homecarouselo'
south_migrationhistory_2.applied = dateutil.parser.parse("2014-01-05T16:51:39.517145+00:00")
south_migrationhistory_2 = importer.save_or_locate(south_migrationhistory_2)
south_migrationhistory_3 = MigrationHistory()
south_migrationhistory_3.app_name = u'caravana4site'
south_migrationhistory_3.migration = u'0003_auto__add_productcategorie__chg_field_product_price__chg_field_product'
south_migrationhistory_3.applied = dateutil.parser.parse("2014-01-19T21:02:05.052134+00:00")
south_migrationhistory_3 = importer.save_or_locate(south_migrationhistory_3)
south_migrationhistory_4 = MigrationHistory()
south_migrationhistory_4.app_name = u'caravana4site'
south_migrationhistory_4.migration = u'0004_auto__del_field_product_cost__del_field_product_created__del_field_pro'
south_migrationhistory_4.applied = dateutil.parser.parse("2014-01-19T22:36:43.132356+00:00")
south_migrationhistory_4 = importer.save_or_locate(south_migrationhistory_4)
south_migrationhistory_5 = MigrationHistory()
south_migrationhistory_5.app_name = u'caravana4site'
south_migrationhistory_5.migration = u'0005_auto__add_field_product_category'
south_migrationhistory_5.applied = dateutil.parser.parse("2014-01-19T22:44:57.623181+00:00")
south_migrationhistory_5 = importer.save_or_locate(south_migrationhistory_5)
south_migrationhistory_6 = MigrationHistory()
south_migrationhistory_6.app_name = u'caravana4site'
south_migrationhistory_6.migration = u'0006_auto__chg_field_product_picture'
south_migrationhistory_6.applied = dateutil.parser.parse("2014-01-21T00:25:11.857792+00:00")
south_migrationhistory_6 = importer.save_or_locate(south_migrationhistory_6)
south_migrationhistory_7 = MigrationHistory()
south_migrationhistory_7.app_name = u'caravana4site'
south_migrationhistory_7.migration = u'0007_auto__add_productdetail'
#.........这里部分代码省略.........
开发者ID:CatBakun,项目名称:caravana4,代码行数:101,代码来源:testdata.py
注:本文中的south.models.MigrationHistory类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论