is_common
is not a field.
macOS
\nNo response
\n0.0.24
\nPython 3.12.10
\nNo response
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"class TOrder(SQLModel, table=True):\n user: str\n is_common: bool = Field(sa_column=Boolean)\n\n __table_args__ = (\n Index('ix_user_common', 'user', postgresql_where=(is_common.sa_column.is_(True)))\n )
this works
","upvoteCount":1,"url":"https://github.com/fastapi/sqlmodel/discussions/1411#discussioncomment-13550575"}}}-
First Check
Commit to Help
Example Codeclass TOrder(SQLModel, table=True):
user: str
is_common: bool
__table_args__ = (
Index('ix_user_common', 'user', postgresql_where=(is_common.is_(True)))
) Description
Operating SystemmacOS Operating System DetailsNo response SQLModel Version0.0.24 Python VersionPython 3.12.10 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
-
class TOrder(SQLModel, table=True):
user: str
is_common: bool = Field(sa_column=Boolean)
__table_args__ = (
Index('ix_user_common', 'user', postgresql_where=(is_common.sa_column.is_(True)))
) this works |
Beta Was this translation helpful? Give feedback.
this works