Fix pk key

This commit is contained in:
Andrew Brookins 2021-08-31 15:52:21 -07:00
parent ce3204325f
commit eeb046bcec
4 changed files with 29 additions and 43 deletions

View file

@ -336,7 +336,7 @@ class RedisModel(BaseModel, metaclass=RedisModelMetaclass):
def key(self):
"""Return the Redis key for this model."""
pk = self.__fields__[self.Meta.primary_key.field.name]
pk = getattr(self, self.Meta.primary_key.field.name)
return self.make_primary_key(pk)
@classmethod