#10839: Pickling queryset.query doesn't work for gis models
---------------------------------+------------------------------------------
          Reporter:  jtiai       |         Owner:  nobody
            Status:  new         |     Milestone:        
         Component:  GIS         |       Version:  SVN   
        Resolution:              |      Keywords:        
             Stage:  Unreviewed  |     Has_patch:  0     
        Needs_docs:  0           |   Needs_tests:  0     
Needs_better_patch:  0           |  
---------------------------------+------------------------------------------
Changes (by Alex):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Old description:

> If I pickle queryset.query which is GIS model I get following results
> (using Oracle as database):
> qs = MyModel.objects.filter(id=12345)
>
> before pickling:
>
> >>> qs.query
> <django.contrib.gis.db.models.sql.query.GeoQuery object at 0x0199FB90>
> >>> qry_str = pickle.dumps(qs.query)
> >>> qry = pickle.loads(qry_str)
> >>> qry
> <django.db.backends.oracle.query.OracleQuery object at 0x019C3F70>
>
> Somehow query object has changed. It works as expected on non GIS models.

New description:

 If I pickle queryset.query which is GIS model I get following results
 (using Oracle as database):
 qs = MyModel.objects.filter(id=12345)

 before pickling:
 {{{
 >>> qs.query
 <django.contrib.gis.db.models.sql.query.GeoQuery object at 0x0199FB90>
 >>> qry_str = pickle.dumps(qs.query)
 >>> qry = pickle.loads(qry_str)
 >>> qry
 <django.db.backends.oracle.query.OracleQuery object at 0x019C3F70>
 }}}
 Somehow query object has changed. It works as expected on non GIS models.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10839#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to