You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AttributeError: 'Country' object has no attribute 'iso3166numeric'
The problem is obviously that attribute name of the primary key of the Country model does not match the name of the column. But it is supported by the SQLAlchemy.
When I have the following models:
And I try to register Customer model in administration like that
I receive an error:
The problem is obviously that attribute name of the primary key of the Country model does not match the name of the column. But it is supported by the SQLAlchemy.
The problem occurs in QueryAjaxModelLoader.format method https://github.com/flask-admin/flask-admin/blob/v1.3.0/flask_admin/contrib/sqla/ajax.py#L50-L54
I found that in SQLAlchemy there is a way to get the value of primary key by using
primary_key_from_instance
method of theMapper
I will try to provide a pull request to show what I mean.
The text was updated successfully, but these errors were encountered: