From b244d70e1686c5e31f779b2a33740354daaaa6f6 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 21 Dec 2014 19:57:01 +0100 Subject: [PATCH] Resolved a UNIQUE id error when re-saving a typeclassed object. This was due to an idmapper hack which I *think* is not needed anymore, but might need to look at this in the future to see if the related lookup is actually using the cache or not. --- src/utils/idmapper/manager.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/utils/idmapper/manager.py b/src/utils/idmapper/manager.py index 2c017b3afb..a1a9ed00f6 100755 --- a/src/utils/idmapper/manager.py +++ b/src/utils/idmapper/manager.py @@ -15,11 +15,15 @@ class SharedMemoryManager(Manager): # rel_obj = rel_mgr.using(db).get(**params) # We need to handle using, or the get method will be called on a vanilla # queryset, and we won't get a change to use the cache. - def using(self, alias): - if alias == router.db_for_read(self.model): - return self - else: - return super(SharedMemoryManager, self).using(alias) + + #TODO - removing this for django1.7 - the call mentioned above doesn't happen + # anymore but is the cache still used? /Griatch + #def using(self, alias): + # if alias == router.db_for_read(self.model): + # # this should return a queryset! + # return self + # else: + # return super(SharedMemoryManager, self).using(alias) # TODO: improve on this implementation # We need a way to handle reverse lookups so that this model can