Electronics & Programming


Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 5, 2011 05:42:31

Robinson B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

PostGISAdapter error

I am getting the following error when the queryset tries to generate the SQL:
"'str' object has no attribute 'ewkb'"

Here is what I am doing that causes the problem:
shapes = Shape.objects.filter(geom__bboverlaps=bbx)
shape_info = shape_info.filter(shape__in=shapes)

Models are:
class Shape(models.Model):

geom = models.PolygonField()
color = models.IntegerField()

class ShapeInfo(models.Model):

name = models.CharField(max_length=25)
shape = models.ForeignKey(Shape)

The code causing the problem seems to be:

if (len(params) == 1 and params == '' and lookup_type == 'exact'
and connection.features.interprets_empty_strings_as_nulls):
lookup_type = 'isnull'
value_annot = True

Is this not an appropriate way to use this?

Here is the stacktrace:
/Library/Python/2.6/site-packages/django/db/models/query.py in _result_iter
self._fill_cache() ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/query.py in _fill_cache
self._result_cache.append(self._iter.next()) ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/query.py in iterator
for row in compiler.results_iter(): ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py in
for rows in self.execute_sql(MULTI): ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py in
sql, params = self.as_sql() ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py in as_sql
where, w_params = self.query.where.as_sql(qn=qn,
connection=self.connection) ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/where.py in as_sql
sql, params = child.as_sql(qn=qn, connection=connection) ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/where.py in as_sql
sql, params = self.make_atom(child, qn, connection) ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/where.py in make_atom
if (len(params) == 1 and params == '' and lookup_type == 'exact' ...
▶ Local vars
in __eq__
return (self.ewkb == other.ewkb) and (self.srid == other.srid) ...
▼ Local vars
Variable Value
<django.contrib.gis.db.backends.postgis.adapter.PostGISAdapter object at

You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.


Board footer

Moderator control

Enjoy the 17th of August

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support