You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Base:
class Meta:
database = redis
class Entity(Base, JsonModel):
name: str = Field(index=True)
some_list: List[str] = Field(index=True, default=[])
random_bool_field: bool = Field(index=True, default=0)
Migrator().run()
for i in range(100):
entity = Entity(name=f"Entity{i}")
entity.save()
entities = Entity.find().all()
assert len(entities) == 100 # <- OK
for i in range(100):
entity = Entity.find(Entity.name == f"Entity{i}").first()
entity.some_list.append("test")
entity.save()
entities = Entity.find().all()
assert len(entities) == 100 # <- AssertionError!
The code works when the bool field is defined without the Field syntax, like random_bool_field: bool = 0 but then I cannot index it.
It also works when I update an integer field instead of the list append.
The text was updated successfully, but these errors were encountered:
To reproduce:
The code works when the bool field is defined without the Field syntax, like
random_bool_field: bool = 0
but then I cannot index it.It also works when I update an integer field instead of the list append.
The text was updated successfully, but these errors were encountered: