Skip to content

Commit

Permalink
Add some comments to give a sense where methods are used by superclass
Browse files Browse the repository at this point in the history
  • Loading branch information
blag committed Oct 15, 2023
1 parent 20839a0 commit ef28ea0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions user_sessions/backends/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ef28ea0

Please sign in to comment.