  ALL_TERMS.update(SpatialBackend.gis_terms)
  
  TABLE_NAME = sql.constants.TABLE_NAME
  get_proxied_model = sql.query.get_proxied_model
  
  class GeoQuery(sql.Query):
 
</s> remove         proxied_model = opts.proxy and opts.proxy_for_model or 0
 </s> add         # Skip all proxy to the root proxied model
        proxied_model = get_proxied_model(opts)

# Pulling out other needed constants/routines to avoid attribute lookups.
  ALL_TERMS.update(SpatialBackend.gis_terms)
  
# Pulling out other needed constants/routines to avoid attribute lookups.
  TABLE_NAME = sql.constants.TABLE_NAME
  get_proxied_model = sql.query.get_proxied_model
  
  class GeoQuery(sql.Query):
keep add keep keep keep keep
 Fixed #11489 -- `GeoQuery.resolve_columns` now recognizes annotations; disabled problematic test cases on Oracle and added notes on why.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@11251 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/contrib/gis/db/models/sql/query.py