adambossy wrote:

> My problem is that I am trying to _write_ session variables before
> calling my view. For example:

Django really falls down here, especially compared to Brand X. Stuff a
session like this:

    def assemble_session(self, dictionary):
        from django.conf import settings
        from django.utils.importlib import import_module
        engine = import_module(settings.SESSION_ENGINE)
        store = engine.SessionStore()
        store.save()  # we need to make load() work, or the cookie is
worthless
        self.client.cookies[settings.SESSION_COOKIE_NAME] =
store.session_key
        session = self.client.session
        session.update(dictionary)
        session.save()

          # and now remember to re-login!

--
  Phlip
  http://c2.com/cgi/wiki?ZeekLand

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to