I'm migrating my SQLAlchemy development from Plone 3.3.5 to Plone 5.2
Have used collective.lead and advices from Datenbankanbindungen — Plone-Entwicklerhandbuch
The transformation to z3c.sqlalchemy 1.5 seems to be ok. I get connection and session and can read metadata und tables.
The mentioned problem occur when a query is started:
place_list = session.query(Place.name.label('name'), Place.id.label('id'), Place.type.label('place_type'), Rural_District.name.label('rural_district'), Rural_District.alias.label('rural_district_alias'),
Data has been modeled via zope.schema, i.e. Place and Rural_District, as shown in Datenmodellierung — Plone-Entwicklerhandbuch
id = schema.Int(title=(u"Place identifier"),
description=(u"A unique id for this place"),
name = schema.TextLine(title=(u"Place name"),
description=(u"The name for this place (last known)"),
type = schema.TextLine(title=(u"Place type"),
description=(u"The type of this place (last known)"),
In Plone 3.3.5 with Python 2.4 and SQLAlchemy-0.4.8 the label method has done in the way as above presented.
Now with Plone 5.2, Python 2.7 and SQLAlchemy-1.2.19 (and z3c.sqlalchemy and zope.sqlalchemy) it seems, that Place.name etc. is no longer interpreted as ColumnElement as defined in sqlalchemy/sql/elements.py but as a simple string.
E.g. Place is initialized by:
id = None
name = ''
type = ''
What do I need to change, that e.g. Place.name will not be interpreted as str but as ColumnElement, or what else is the recommendation.