#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: | no | UI/UX: | no |
Description
from django.contrib.gis.db import models
from django.contrib.gis.geos import Point
class Location(models.Model):
point = models.PointField()
bool(Location.objects.filter(point=Point(1,0)))
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 by , 16 years ago
| Component: | Uncategorized → GIS |
|---|
comment:2 by , 16 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
comment:3 by , 16 years ago
Thanks jbronn!
The error is a little misleading, though, and the result of user error probably shouldn't be generating invalid SQL.
Ian
Note:
See TracTickets
for help on using tickets.
You forgot:
See also the GeoManager documentation.