python - SQLAlchemy Error in elements.py - ColumnClause nor Comparator has 'description' -
the full error is:
attributeerror: neither 'columnclause' object nor 'comparator' object has attribute 'description' occuring @ line 544 in sqlalchemy\sql\elements.py in __ repr __
at line 735 in sqlalchemy\sql\elements.py in __ getattr__
i discovered problem because flask templates, iterates through orm object.__ dict__ output data table, not displaying particular row.
after digging python console , importing module, produce error trying print property of object.
from app.models import parcel o = parcel.query.get(1) o.parcelid #string field prints correct value, no problem o.yrbuilt #integer field, same, no problem o.streetnum #string field, throws above error my model (db variable sqlalchemy(app)):
class parcel(db.model): """ county parcel data """ __tablename__ = 'parcel' __table_args__ = {'schema':'gisdata'} ogc_fid = db.column(db.integer, primary_key=true, info={'widget': hiddeninput()} ) parcelid = db.column(db.string(15)) unit_no = db.column(db.string(20)) streetnum = db.column(db.string(100)) streetname = db.column(db.string(255)) city = db.column(db.string(100)) mailaddr = db.column(db.string(255)) mailcity = db.column(db.string(100)) mailstate = db.column(db.string(5)) mailzip = db.column(db.string(20)) gp_plat = db.column(db.string(255)) district = db.column(db.string(255)) emv_bldg = db.column(db.integer()) yrbuilt = db.column(db.integer()) any clue i'm doing wrong here?
column should capitalized, in:
streetnum = db.column(db.string(100))
:)
Comments
Post a Comment