vendredi 4 septembre 2015

"Adapter does not support geometry" exception when declaring geometry field

In my application, an "Adapter does not support geometry" exception is being thrown when attempting to create a field of type, "geometry()". For my test application, I'm using an sqlite DB (production will use postgres):

db = DAL('sqlite://storage.sqlite', pool_size = 1, fake_migrate_all= False)

The DB table in question is declared within a class, inside of a module, and contains a several fields, some of which contain location data:

from gluon.dal import Field, geoPoint, geoLine, geoPolygon

class Info(Base_Model):

    def __init__(...):

        try: 
            db.define_table('t_info', 
                ...
                Field('f_geolocation', type='geometry()', 
                    label =  current.T('Geolocation')),
                Field('f_city', type='string', 
                    label = current.T('City')),
                ...
        except Exception as e:
            ...

Aucun commentaire:

Enregistrer un commentaire