Skip to content

How to show @property field in ModelView #590

Answered by jowilf
ps96068 asked this question in Q&A
Discussion options

You must be logged in to vote

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),
    ]

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ps96068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants