Skip to content

How to inherit Class with ‘sa_column’ in a proper way? #906

Closed Answered by joachimhuet
zhu-lingfeng asked this question in Questions
Discussion options

You must be logged in to vote

You are right there is a strange behaviour here but what you can actually do is to use sa_type instead of sa_column.

This should work as expected:

class ReportItemBase(SQLModel):
    ...
    full_content: Optional[dict] = Field(None, sa_type=JSON)

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@zhu-lingfeng
Comment options

Answer selected by zhu-lingfeng
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@joachimhuet
Comment options

@elefher
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
3 participants