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: torsten...@jabber.rwth-aachen.de
or http://bronger-jmp.appspot.com
Tim Shaffer writes:
> Looks like there might already be a ticket open to fix this:
>
> https://code.djangoproject.com/ticket/16563
Wow, thank you! Since 1.3 is not affected and 1.4 won't be
probably, this means that we don't have to do anything.
Not really. To 1.4 not be affected, someone needs to write a patch for
that ticket. This can be you ;)
--
Łukasz Rekucki
Łukasz Rekucki writes:
> On 16 September 2011 22:05, Torsten Bronger
> <bro...@physik.rwth-aachen.de> wrote:
>
>> this means that we don't have to do anything.
>
> Not really. To 1.4 not be affected, someone needs to write a patch
> for that ticket.
Of course you are right. I was only refering to "Milestone 1.4" and
"Release blocker" which means that it has high priority.
Tschö,