Skip to content
This repository was archived by the owner on Aug 4, 2022. It is now read-only.

Commit d08aa49

Browse files
author
Steven Arcangeli
committed
Fixing another bug with non-id primary keys
1 parent 923cc98 commit d08aa49

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

stdnet/backends/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def ping(self):
306306

307307
def instance_keys(self, obj):
308308
'''Return a list of database keys used by instance *obj*'''
309-
return [self.basekey(obj._meta, obj.id)]
309+
return [self.basekey(obj._meta, obj.pkvalue())]
310310

311311
def auto_id_to_python(self, value):
312312
'''Return a proper python value for the auto id.'''

stdnet/backends/redisb/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ def model_keys(self, meta):
861861

862862
def instance_keys(self, obj):
863863
meta = obj._meta
864-
keys = [self.basekey(meta, OBJ, obj.id)]
864+
keys = [self.basekey(meta, OBJ, obj.pkvalue())]
865865
for field in meta.multifields:
866866
f = getattr(obj, field.attname)
867867
be = self.structure(f)

0 commit comments

Comments
 (0)