          values = []
          aliases = self.extra_select.keys()
  
          # Have to set a starting row number offset that is used for
          # determining the correct starting row index -- needed for
          # doing pagination with Oracle.
          rn_offset = 0
          if SpatialBackend.oracle:
 
</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)
 </s> remove     def test12_count(self):
        "Testing `Count` aggregate use with the `GeoManager`. See #11087."
 </s> add     # TODO: fix on Oracle -- get the following error because the SQL is ordered
    # by a geometry object, which Oracle apparently doesn't like:
    #  ORA-22901: cannot compare nested table or VARRAY or LOB attributes of an object type
    @no_oracle
    def test12a_count(self):
        "Testing `Count` aggregate use with the `GeoManager` on geo-fields." </s> remove         # the annotation should have 3 for the number of books.
 </s> add         # the annotation should have 3 for the number of books.  Also testing
        # with a `GeoValuesQuerySet` (see #11489).
        if self.aggregates:
            # If we have an aggregate annotation, must extend the aliases
            # so their corresponding row values are included.
            aliases.extend([None for i in xrange(len(self.aggregates))])
          values = []
          aliases = self.extra_select.keys()
        if self.aggregates:
            # If we have an aggregate annotation, must extend the aliases
            # so their corresponding row values are included.
            aliases.extend([None for i in xrange(len(self.aggregates))])
  
          # Have to set a starting row number offset that is used for
          # determining the correct starting row index -- needed for
          # doing pagination with Oracle.
          rn_offset = 0
          if SpatialBackend.oracle:
keep add keep keep 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