yield row
def _get_query_hash(self):
- return md5(unicode(self.query).encode("utf-8")).hexdigest()
-
+ try:
+ return md5(unicode(self.query).encode("utf-8")).hexdigest()
+ except:
+ try:
+ return md5(self.query).hexdigest()
+ except:
+ return md5(str(self.query)).hexdigest()
class CachedManager(models.Manager):