Closed avclicky closed 1 year ago
Greetings,
Thank you for this project. When working with models utilizing column_property, my program throws the following exception:
AttributeError: Neither 'Label' object nor 'Comparator' object has an attribute 'onupdate'
This can be traced to ./views/helpers.py. A simple proposed fix to changes_on_update () is below:
return any(hasattr(column, 'onupdate') and column.onupdate is not None for column in sqlalchemy_inspect(model).columns)
This change ensures that a respective column has the onupdate attribute to begin with before evaluating it.
I'm not familiar enough with SQLAlchemy internals to know if the above change has unintended side-effects, but it has ostensibly solved my problem.
Hi, thank you for the report, and sorry for the late response.
Is there a way I can reproduce the error?
or could you please provide a full stacktrace?
Greetings,
Thank you for this project. When working with models utilizing column_property, my program throws the following exception:
AttributeError: Neither 'Label' object nor 'Comparator' object has an attribute 'onupdate'
This can be traced to ./views/helpers.py. A simple proposed fix to changes_on_update () is below:
return any(hasattr(column, 'onupdate') and column.onupdate is not None for column in sqlalchemy_inspect(model).columns)
This change ensures that a respective column has the onupdate attribute to begin with before evaluating it.
I'm not familiar enough with SQLAlchemy internals to know if the above change has unintended side-effects, but it has ostensibly solved my problem.