Fix pk key
This commit is contained in:
parent
ce3204325f
commit
eeb046bcec
4 changed files with 29 additions and 43 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue