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


Python HistoricalRecords.create_history_model方法代码示例

本文整理汇总了Python中simple_history.models.HistoricalRecords.create_history_model方法的典型用法代码示例。如果您正苦于以下问题:Python HistoricalRecords.create_history_model方法的具体用法?Python HistoricalRecords.create_history_model怎么用?Python HistoricalRecords.create_history_model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在simple_history.models.HistoricalRecords的用法示例。


在下文中一共展示了HistoricalRecords.create_history_model方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_create_history_model_with_one_to_one_field_to_char_field

# 需要导入模块: from simple_history.models import HistoricalRecords [as 别名]
# 或者: from simple_history.models.HistoricalRecords import create_history_model [as 别名]
 def test_create_history_model_with_one_to_one_field_to_char_field(self):
     records = HistoricalRecords()
     records.module = Bookcase.__module__
     try:
         records.create_history_model(Bookcase)
     except:
         self.fail("SimpleHistory should handle foreign keys to one to one"
                   "fields to char fields without throwing an exception.")
开发者ID:dgreisen-cfpb,项目名称:django-simple-history,代码行数:10,代码来源:tests.py

示例2: test_create_history_model_with_one_to_one_field_to_integer_field

# 需要导入模块: from simple_history.models import HistoricalRecords [as 别名]
# 或者: from simple_history.models.HistoricalRecords import create_history_model [as 别名]
 def test_create_history_model_with_one_to_one_field_to_integer_field(self):
     records = HistoricalRecords()
     records.module = AdminProfile.__module__
     try:
         records.create_history_model(AdminProfile)
     except:
         self.fail("SimpleHistory should handle foreign keys to one to one"
                   "fields to integer fields without throwing an exception")
开发者ID:dgreisen-cfpb,项目名称:django-simple-history,代码行数:10,代码来源:tests.py

示例3: test_create_history_model_with_multiple_one_to_ones

# 需要导入模块: from simple_history.models import HistoricalRecords [as 别名]
# 或者: from simple_history.models.HistoricalRecords import create_history_model [as 别名]
 def test_create_history_model_with_multiple_one_to_ones(self):
     records = HistoricalRecords()
     records.module = MultiOneToOne.__module__
     try:
         records.create_history_model(MultiOneToOne)
     except:
         self.fail("SimpleHistory should handle foreign keys to one to one"
                   "fields to one to one fields without throwing an "
                   "exception.")
开发者ID:dgreisen-cfpb,项目名称:django-simple-history,代码行数:11,代码来源:tests.py


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