@classmethod
def _generate_cache_key(cls, key, group="node"):
return super(Node, cls)._generate_cache_key(key, group)
-
+
@classmethod
def get_type(cls):
return cls.__name__.lower()
return nis
+ @property
+ def last_activity(self):
+ try:
+ return self.actions.order_by('-action_date')[0].action_date
+ except:
+ return self.last_seen
+
@property
def state_list(self):
return [s.state_type for s in self.states.all()]
from forum.models import Question
from django.conf import settings
-class QuestionsSitemap(Sitemap):
+class OsqaSitemap(Sitemap):
changefreq = 'daily'
priority = 0.5
def items(self):
{% load cache %}\r
{% block metadescription %}{{question.summary}}{% endblock %}\r
{% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %}\r
-{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}\r
-{% block forejs %}\r
+{% block meta %}\r
<link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />\r
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ question.get_absolute_url }}?type=rss">\r
+{% endblock %}\r
+{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}\r
+{% block forejs %}\r
{% if not question.nis.closed %}\r
<script type='text/javascript' src='{% media "/media/js/wmd/showdown.js" %}'></script>\r
<script type='text/javascript' src='{% media "/media/js/wmd/wmd.js" %}'></script>\r
\r
{% block title %}{% spaceless %}{{ page_title }}{% endspaceless %}{% endblock %}\r
\r
-{% block forejs %}\r
+{% block meta %}\r
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ feed_url }}">\r
{% endblock %}\r
\r
from django.conf import settings as djsettings
from django.contrib import admin
from forum import views as app
-from forum.sitemap import QuestionsSitemap
+from forum.sitemap import OsqaSitemap
from django.utils.translation import ugettext as _
import logging
admin.autodiscover()
sitemaps = {
- 'questions': QuestionsSitemap
+ 'questions': OsqaSitemap
}
APP_PATH = os.path.dirname(__file__)