diff --git a/user_sessions/backends/db.py b/user_sessions/backends/db.py index 2a5e63f..3eb0315 100644 --- a/user_sessions/backends/db.py +++ b/user_sessions/backends/db.py @@ -13,6 +13,7 @@ def __init__(self, session_key=None, user_agent=None, ip=None): self.ip = ip self.user_id = None + # Used by superclass to get self.model, which is used elsewhere @classmethod def get_model_class(cls): # Avoids a circular import and allows importing SessionStore when @@ -26,6 +27,7 @@ def __setitem__(self, key, value): self.user_id = value super().__setitem__(key, value) + # Used in DBStore.load() def _get_session_from_db(self): s = super()._get_session_from_db() self.user_id = s.user_id @@ -38,6 +40,7 @@ def create(self): super().create() self._session_cache = {} + # Used in DBStore.save() def create_model_instance(self, data): """ Return a new instance of the session model object, which represents the