-
Hello in one my SQLAlchemy model i have a @Property field, look at the code:
if i create ModelView:
have an errore: ValueError: Can't find column with key session_duration can somebody help me to solve this problem? thanks in advance |
Beta Was this translation helpful? Give feedback.
Answered by
jowilf
Oct 13, 2024
Replies: 1 comment
-
You are having this error because session_duration is not an SQLAlchemy column and cannot be auto-detected by the current converter logic. In that case, you have to set the field: class UserActivityView(ModelView):
fields = [
"id",
"session_start",
"session_end",
"user_id",
IntegerField("session_duration", exclude_from_edit=True, exclude_from_create=True),
] |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ps96068
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are having this error because session_duration is not an SQLAlchemy column and cannot be auto-detected by the current converter logic. In that case, you have to set the field: