Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12334 closed (invalid)

GeoQuerySet creates invalid SQL on calls to `__nonzero__` or `__len__`

Reported by: wardi Owned by: nobody
Component: GIS Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


from django.contrib.gis.db import models
from django.contrib.gis.geos import Point

class Location(models.Model):
    point = models.PointField()


causes an exception in the regular django db layer (not the gis one), it looks like the implementation of __nonzero__ and __len__ in QuerySet are not properly overridden by GeoQuerySet.

Change History (3)

comment:1 Changed 8 years ago by wardi

Component: UncategorizedGIS

comment:2 Changed 8 years ago by jbronn

Resolution: invalid
Status: newclosed

You forgot:

    objects = models.GeoManager()

See also the GeoManager documentation.

comment:3 Changed 8 years ago by wardi

Thanks jbronn!

The error is a little misleading, though, and the result of user error probably shouldn't be generating invalid SQL.


Note: See TracTickets for help on using tickets.
Back to Top