mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 17:56:32 +01:00
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.
This commit is contained in:
parent
3b704d37dc
commit
b244d70e16
1 changed files with 9 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue