#todo: temporary thing, for now lets just assume that the site owner will always be the first user of the application
return self.id == 1
+ @property
+ def decorated_name(self):
+ if settings.SHOW_STATUS_DIAMONDS:
+ if self.is_superuser:
+ return u"%s \u2666\u2666" % self.username
+
+ if self.is_staff:
+ return u"%s \u2666" % self.username
+
+ return self.username
+
@property
def gravatar(self):
return md5(self.email).hexdigest()
def get_absolute_url(self):
return self.get_profile_url()
+ @models.permalink
+ def get_asked_url(self):
+ return ('user_questions', (), {'mode': _('asked-by'), 'user': self.id, 'slug': slugify(self.username)})
+
+ @models.permalink
+ def get_answered_url(self):
+ return ('user_questions', (), {'mode': _('answered-by'), 'user': self.id, 'slug': slugify(self.username)})
+
+ @models.permalink
+ def get_subscribed_url(self):
+ return ('user_questions', (), {'mode': _('subscribed-by'), 'user': self.id, 'slug': slugify(self.username)})
+
def get_profile_link(self):
profile_link = u'<a href="%s">%s</a>' % (self.get_profile_url(), self.username)
return mark_safe(profile_link)