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

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: 4 comments 3 replies

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

Answer selected by zhu-lingfeng

You must be logged in to vote
0 replies

You must be logged in to vote
2 replies
@joachimhuet

@elefher

You must be logged in to vote
0 replies
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