Ticket #10839: geoquery_pickle_orcl.diff
File geoquery_pickle_orcl.diff, 1.4 KB (added by , 16 years ago) |
---|
-
django/contrib/gis/db/models/sql/query.py
32 32 self.custom_select = {} 33 33 self.transformed_srid = None 34 34 self.extra_select_fields = {} 35 36 if SpatialBackend.oracle: 37 def __reduce__(self): 38 if hasattr(GeoQuery, '__getstate__'): 39 assert hasattr(GeoQuery, '__setstate__') 40 data = self.__getstate__() 41 else: 42 data = self.__dict__ 43 return (unpickle_query_class, (GeoQuery,), data) 35 44 36 45 def clone(self, *args, **kwargs): 37 46 obj = super(GeoQuery, self).clone(*args, **kwargs) … … 332 341 # Otherwise, check by the given field name -- which may be 333 342 # a lookup to a _related_ geographic field. 334 343 return GeoWhereNode._check_geo_field(self.model._meta, field_name) 344 345 if SpatialBackend.oracle: 346 def unpickle_query_class(QueryClass): 347 """ 348 Utility function, called by Python's unpickling machinery, that handles 349 unpickling of Oracle Query subclasses. 350 """ 351 return QueryClass.__new__(QueryClass) 352 unpickle_query_class.__safe_for_unpickling__ = True