本文整理汇总了Python中simple_history.models.HistoricalRecords类的典型用法代码示例。如果您正苦于以下问题:Python HistoricalRecords类的具体用法?Python HistoricalRecords怎么用?Python HistoricalRecords使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HistoricalRecords类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_history_model_with_one_to_one_field_to_char_field
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.")
示例2: test_create_history_model_with_one_to_one_field_to_integer_field
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")
示例3: test_create_history_model_with_multiple_one_to_ones
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.")