I have a sqlalchemy2 (with geoalchemy extension) model containing geometry data type like so:
class Estate(db.Model):
id = db.Column(db.Integer, primary_key=True)
geom = db.Column(Geometry(geometry_type='POLYGON')
user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
user = db.relationship('Users', backref='estates')
and the marshmallow schema:
class EstateSchema(ma.ModelSchema):
class Meta:
model = Estates
but during attempt of serialization I received following error:
marshmallow_sqlalchemy.exceptions.ModelConversionError: Could not find field column of type <class 'geoalchemy2.types.Geometry'>.
The ModelConversion complaining about WKBElement, because is not defined as a common field.
Question is, how can I modify the code, to get the (de)serializer working with Geometry model field?