From 0486af4bba7414ca62f9dd5c7da52b2bb1029517 Mon Sep 17 00:00:00 2001 From: Carlos Henrique Romano Date: Wed, 30 Jul 2014 15:57:45 -0300 Subject: [PATCH] Remove unused code --- symposion/proposals/managers.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 symposion/proposals/managers.py diff --git a/symposion/proposals/managers.py b/symposion/proposals/managers.py deleted file mode 100644 index e6ca5245..00000000 --- a/symposion/proposals/managers.py +++ /dev/null @@ -1,22 +0,0 @@ -from django.db import models -from django.db.models.query import QuerySet - - -class CachingM2MQuerySet(QuerySet): - - def __init__(self, *args, **kwargs): - super(CachingM2MQuerySet, self).__init__(*args, **kwargs) - self.cached_m2m_field = kwargs["m2m_field"] - - def iterator(self): - parent_iter = super(CachingM2MQuerySet, self).iterator() - - for obj in parent_iter: - if obj.id in cached_objects: - setattr(obj, "_cached_m2m_%s" % self.cached_m2m_field) - yield obj - - -class ProposalManager(models.Manager): - def cache_m2m(self, m2m_field): - return CachingM2MQuerySet(self.model, using=self._db, m2m_field=m2m_field)