How to create a field that does not end up in the table? #1014
Unanswered
vinodkumars
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
I have a field called
text_content
of typeTextMessageContent
. I do not want it to end up in the table. Its data is serialized and stored in a different field calledserialized_data
. But I want it to be available inMessageContentCreate
andMessageContentPublic
.Read path:
Write path:
How can I make it so that
text_content
does not end up in the database?I don't think pydantic.PrivateAttr() is an option as it doesn't play well with inheritance and enforces a
_
prefix. (Feel free to correct me if I am wrong)Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.19
Python Version
3.11.8
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions