﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11087	Filtering by Count aggregate does not work when using GeoManager	David Gouldin	jbronn	"Using the following models:

{{{
from django.contrib.gis.db import models

class Book(models.Model):
    name = models.CharField(max_length=100)
    objects = models.GeoManager()

class Author(models.Model):
    name = models.CharField(max_length=100)
    books = models.ForeignKey(Book, related_name=""authors"")
    objects = models.GeoManager()
}}}

Filtering on an annotated Count aggregate raises an AttributeError.  Example:

{{{
>>> from mytestapp.models import Book, Author

>>> from django.db.models import Count

>>> Book.objects.annotate(num_authors=Count('authors')).filter(num_authors__gt=1)
...
<type 'exceptions.AttributeError'>: 'Count' object has no attribute 'alias'
}}}


"		closed	GIS	dev		fixed		jdunck@… dgouldin@…	Accepted	1	0	1	0	0	0
