from shapely.wkb import loads
class testpoly(SQLObject):
_connection = connection
_fromDatabase = True
nom = StringCol()
the_geom = StringCol()
# modification du résulat à l'aide du module shapely qui sait décoder le format wkb
def _get_the_geom(self):
valeur=self._SO_get_the_geom()
res = loads(valeur.decode('hex')).wkt
return res
a = testpoly.get(1)
print a.the_geom
'POLYGON ((0.0909447004608300 0.8075576036866360, 0.1416359447004610 0.8014746543778800, 0.3606221198156680 0.7021198156682030, 0.2409907834101380 0.5480184331797230, 0.0868894009216590 0.5845161290322580, 0.0544470046082950 0.7426728110599080, 0.0909447004608300 0.8075576036866360))'