summaryrefslogtreecommitdiffstats
path: root/forum/models/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'forum/models/__init__.py')
-rwxr-xr-xforum/models/__init__.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/forum/models/__init__.py b/forum/models/__init__.py
index db66a227..fee52447 100755
--- a/forum/models/__init__.py
+++ b/forum/models/__init__.py
@@ -2,7 +2,7 @@ from question import Question ,QuestionRevision, QuestionView, AnonymousQuestion
from answer import Answer, AnonymousAnswer, AnswerRevision
from tag import Tag, MarkedTag
from meta import Vote, Comment, FlaggedItem
-from user import Activity, AnonymousEmail, EmailFeedSetting, AuthKeyUserAssociation
+from user import Activity, ValidationHash, EmailFeedSetting, AuthKeyUserAssociation
from repute import Badge, Award, Repute
import re
@@ -34,6 +34,9 @@ def user_get_q_sel_email_feed_frequency(self):
#print 'have freq=%s' % feed_setting.frequency
return feed_setting.frequency
+def user_get_absolute_url(self):
+ return "/users/%d/%s/" % (self.id, (self.username))
+
User.add_to_class('is_approved', models.BooleanField(default=False))
User.add_to_class('email_isvalid', models.BooleanField(default=False))
User.add_to_class('email_key', models.CharField(max_length=32, null=True))
@@ -68,6 +71,7 @@ User.add_to_class('tag_filter_setting',
default='ignored'
)
)
+User.add_to_class('get_absolute_url', user_get_absolute_url)
# custom signal
tags_updated = django.dispatch.Signal(providing_args=["question"])
@@ -294,7 +298,6 @@ def post_stored_anonymous_content(sender,user,session_key,signal,*args,**kwargs)
aa.publish(user)
#signal for User modle save changes
-
pre_save.connect(calculate_gravatar_hash, sender=User)
post_save.connect(record_ask_event, sender=Question)
post_save.connect(record_answer_event, sender=Answer)
@@ -338,7 +341,7 @@ Repute = Repute
Activity = Activity
EmailFeedSetting = EmailFeedSetting
-AnonymousEmail = AnonymousEmail
+ValidationHash = ValidationHash
AuthKeyUserAssociation = AuthKeyUserAssociation
__all__ = [
@@ -364,7 +367,7 @@ __all__ = [
'Activity',
'EmailFeedSetting',
- 'AnonymousEmail',
+ 'ValidationHash',
'AuthKeyUserAssociation',
'User'