Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed potential circular import problem.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14564 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f6363bc62849f44df655bd9a7723fc30849ee915 1 parent b6ec268
@spookylukey spookylukey authored
View
6 django/contrib/sessions/backends/db.py
@@ -1,11 +1,11 @@
import datetime
from django.conf import settings
-from django.contrib.sessions.models import Session
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation
from django.db import IntegrityError, transaction, router
from django.utils.encoding import force_unicode
+
class SessionStore(SessionBase):
"""
Implements database session store.
@@ -76,3 +76,7 @@ def delete(self, session_key=None):
Session.objects.get(session_key=session_key).delete()
except Session.DoesNotExist:
pass
+
+
+# At bottom to avoid circular import
+from django.contrib.sessions.models import Session
View
3  django/contrib/sessions/models.py
@@ -4,6 +4,7 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
+
class SessionManager(models.Manager):
def encode(self, session_dict):
"""
@@ -51,4 +52,6 @@ class Meta:
def get_decoded(self):
return SessionStore().decode(self.session_data)
+
+# At bottom to avoid circular import
from django.contrib.sessions.backends.db import SessionStore
Please sign in to comment.
Something went wrong with that request. Please try again.