def _capture_change_info(self):
"""Capture the change info for the new version. By default calls:
(1) :meth:`_fetch_current_user_id` which should return a string or None; and
(2) :meth:`_fetch_remote_addr` which should return an IP address string or None;
(3) :meth:`_get_custom_change_info` which should return a 1-depth dict of additional keys.
These 3 methods generate a ``change_info`` and with 2+ top-level keys (``user_id``,
``remote_addr``, and any keys from :meth:`_get_custom_change_info`)
"""
change_info = {
'user_id': self._fetch_current_user_id(),
'remote_addr': self._fetch_remote_addr(),
}
extra_info = self._get_custom_change_info()
if extra_info:
change_info.update(extra_info)
return change_info
评论列表
文章目录