示例#1
0
 def process_request(self, request):
     """
     Set the thread's pinning flag according to the presence of the session
     variable.
     """
     pinned_until = request.session.get(PINNING_KEY, False)
     if pinned_until and pinned_until > datetime.now():
         pinning.pin_thread()
示例#2
0
 def process_request(self, request):
     """
     Set the thread's pinning flag according to the presence of the session
     variable.
     """
     pinned_until = request.session.get(PINNING_KEY, False)
     if pinned_until and pinned_until > datetime.now():
         pinning.pin_thread()
示例#3
0
 def process_request(self, request):
     """
     Set the thread's pinning flag according to the presence of the cookie.
     """
     if PINNING_KEY in request.COOKIES:
         pinning.pin_thread()
示例#4
0
 def db_for_write(self, model, **hints):
     pinning.set_db_write()
     pinning.pin_thread()
     return super(PinningMixin, self).db_for_write(model, **hints)
示例#5
0
 def db_for_write(self, model, **hints):
     pinning.set_db_write()
     pinning.pin_thread()
     return super(PinningMixin, self).db_for_write(model, **hints)
示例#6
0
 def process_request(self, request):
     """
     Set the thread's pinning flag according to the presence of the cookie.
     """
     if PINNING_KEY in request.COOKIES:
         pinning.pin_thread()