We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I've tripped over how the .pk property works for Models.
.pk
Consider this:
>>> from redis_om import HashModel, Field, Migrator ... ... class A(HashModel): ... x: int ... ... class B(HashModel): ... x: int = Field(primary_key=True) ... ... Migrator().run() ... ... a = A(x=3) ... b = B(x=3) >>> a.pk '01H9MZDZRHHDAQZY28F7ETGFHB' >>> b.pk <redis_om.model.model.ExpressionProxy object at 0x7f635ceb1d50>
ExpressionProxy
b.pk
In my opinion, using any HashModel or JsonModel should not require knowledge about whether their pk is auto-generated or explicitly declared.
HashModel
JsonModel
pk
I hope this was not described anywhere in the docs, but I did not find anything.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I've tripped over how the
.pk
property works for Models.Consider this:
ExpressionProxy
object?b.pk
not 3?In my opinion, using any
HashModel
orJsonModel
should not require knowledge about whether theirpk
is auto-generated or explicitly declared.I hope this was not described anywhere in the docs, but I did not find anything.
The text was updated successfully, but these errors were encountered: