Hallöchen!

Since <https://code.djangoproject.com/changeset/16305>, request.user
is a SimpleLazyObject.  This means that

    def my_simple_test_view(request):
        import pickle
        pickle.dumps(request.user)

fails.  Since we put objects in the cache which contain
request.user, we saw a traceback when updating our SVN Django
recently.

I added a function

    def unlazy_object(lazy_object):
        if lazy_object._wrapped is None:
            lazy_object._setup()
        return lazy_object._wrapped

    user = unlazy_object(request.user)

This works.  But is this the way to go?  Is it possible to make
SimpleLazyObject pickable in the first place?

Tschö,
Torsten.

-- 
Torsten Bronger    Jabber ID: [email protected]
                                  or http://bronger-jmp.appspot.com

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

Reply via email to