假设我有这样的模型:
class Account(models.Model):
balance = models.IntegerField()
debt = models.IntegerField()
history = HistoricalRecords()
我正在使用 django-simple-history 来获取模型的实例,因为它在提供的日期和时间已经存在:
inst = Account.history.as_of(datetime.datetime.now().date)
它工作正常,但我想获得一个实例,其中余额字段表示为在提供的日期和时间存在,然后债务字段将是该日期的最新字段。我不知道这是否可能,没有找到任何相关信息。