Closed inari6735 closed 2 years ago
Is this necessary? expire is in RedisModel that both HashModel and JsonModel extend, so this works already with the current release of Redis OM Python:
expire
RedisModel
HashModel
JsonModel
# app.py from redis_om import JsonModel class TestEntity(JsonModel): field_one: str field_two: str some_entity = TestEntity( field_one = "Hello", field_two = "World" ) some_entity.save() some_entity.expire(30) print(TestEntity.db().ttl(some_entity.key()))
$ python app.py 30
Ahh i just worked with the old version of this repo in my project and there was not .expire() method. I missed it. It is not necessary.
Is this necessary?
expire
is inRedisModel
that bothHashModel
andJsonModel
extend, so this works already with the current release of Redis OM Python: