On Thu, 2008-08-28 at 06:51 -0700, paulh wrote:
> django svn version 8659
> I have some django code that runs perfectly against postgres
> (psycopg2), but fails with: PicklingError: Can't pickle <class
> 'django.db.backends.oracle.query.OracleQuery'>: attribute lookup
> django.db.backends.oracle.query.OracleQuery failed
> when run against an Oracle XE database.
> 
> Just wondered whether anyone else had encountered this type of
> problem.

Yes, it's a known restriction because the OracleQuery class is
dynamically defined (Python can only normally pickle classes defined at
the top level). I'm working on what I hope might be a solution for 1.0.

The workaround is to manually convert your queryset to a list and
pickle/cache the list rather than the queryset. For almost all
use-cases, that should be equivalent. The case where it fails is when
you want to unpickle and then call extra queryset methods so, for now,
don't do that if you're using the Oracle backend.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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