This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QuerySetDoubleIteration(Exception): | |
"A QuerySet was iterated over twice, you probably want to list() it." | |
pass | |
# "Skinny" here means we use iterator by default, rather than | |
# ballooning in memory. | |
class SkinnyManager(Manager): | |
def get_query_set(self): | |
return SkinnyQuerySet(self.model, using=self._db) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Thread-safe Django cache backend for pylibmc. | |
Tested on Python 2.6, should work on 2.5 as well. | |
Use it by setting CACHE_BACKEND in settings.py, e.g.: | |
CACHE_BACKEND = 'projdir.utils.pylibmcd://127.0.0.1:11211/' | |
And here's how to properly install pylibmcd in Ubuntu for mod_wsgi: |
NewerOlder