import datetime
-import hashlib
from urllib import quote_plus, urlencode
from django.db import models, IntegrityError, connection, transaction
from django.utils.http import urlquote as django_urlquote
self.wikified_at = datetime.datetime.now()
self.save()
- def save(self, *args, **kwargs):
- self.__dict__['score'] = self.__dict__['vote_up_count'] - self.__dict__['vote_down_count']
- super(QandA,self).save(*args, **kwargs)
-
- try:
- ping_google()
- except Exception:
- logging.debug('problem pinging google did you register you sitemap with google?')
\r
if self.parent_id and not self.abs_parent_id:\r
self.abs_parent = self.parent.absolute_parent\r
+\r
+ self.__dict__['score'] = self.__dict__['vote_up_count'] - self.__dict__['vote_down_count']\r
\r
tags = self.get_tag_list_if_changed()\r
super(Node, self).save(*args, **kwargs)\r
from django.contrib.contenttypes.models import ContentType\r
from django.contrib.auth.models import User as DjangoUser, AnonymousUser as DjangoAnonymousUser\r
from django.db.models import Q\r
-from hashlib import md5\r
+try:\r
+ from hashlib import md5\r
+except:\r
+ import md5\r
import string\r
from random import Random\r
\r
\r
@property\r
def gravatar(self):\r
- return hashlib.md5(self.email).hexdigest()\r
+ return md5(self.email).hexdigest()\r
\r
def save(self, *args, **kwargs):\r
if self.reputation < 0:\r