不,没有一个字段向您显示哪个字段在哪个时间更新,您应该自己实现它
你应该使用
set_password
管理更新密码时间的所有位置
password_updated_at = models.DateTimeField(_('password updated at'))
def set_password(self, raw_password):
r = super(User, self).set_password(raw_password=raw_password)
self.password_updated_at = timezone.now()
self.save()
return r
def is_password_updated_at_expired(self):
duration = (timezone.now() - self.password_updated_at).total_seconds()
return duration > settings.PASSWORD_UPDATE_EXPIRE_TIME, duration