10000 TypeDecorator not working with 0.6 nor with 0.7.2 · Issue #33 · geoalchemy/geoalchemy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
TypeDecorator not working with 0.6 nor with 0.7.2 #33
Open
@georgthegreat

Description

@georgthegreat

Hi!

I'm trying to implement a TypeDecorator which will convert a GeometryColumn to and from shapely.geometry.

I've the following code:

class DatabaseGeometry(types.TypeDecorator):
    impl = geoalchemy.Polygon

    def process_bind_param(self, value, dialect):
        logging.debug("saving")
        return to_db_geom(value)

    def process_result_value(self, value, dialect):
        logging.debug("loading")
        return to_shapely_geom(value)

When I load a Column from database, I can see "loading" in the log, but when I write object.geom = shapely_geom no "saving" occurs.

How can I fix my code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0