--- /dev/null
+from base import Setting, SettingSet
+from django.forms.widgets import Textarea, RadioSelect, Select
+from django.utils.translation import ugettext_lazy as _
+
+SITEMAP_SET = SettingSet('sitemap', _('Sitemap settings'), _("Some settings connected with the Sitemaps."), 2000)
+
+QUESTIONS_SITEMAP_LIMIT = Setting('QUESTIONS_SITEMAP_LIMIT', 2500, SITEMAP_SET, dict(
+label = _("Questions Sitemap Limit"),
+help_text = _("The questions limit per page for the Questions Sitemap.")))
+
+QUESTIONS_SITEMAP_CHANGEFREQ = Setting('QUESTIONS_SITEMAP_CHANGEFREQ', 'daily', SITEMAP_SET, dict(
+label = _("Questions Sitemap Change Fraquence"),
+help_text = _("Used in the Questions Sitemap <changefreq> tag and specifies the content change frequency.")))
from django.contrib.sitemaps import Sitemap
from forum.models import Question
+from forum.settings import QUESTIONS_SITEMAP_LIMIT, QUESTIONS_SITEMAP_CHANGEFREQ
from django.conf import settings
from django.http import HttpResponse, Http404
from django.template import loader
return HttpResponse(xml, mimetype='application/xml')
class OsqaSitemap(Sitemap):
- limit = 2500
- changefreq = 'daily'
+ limit = QUESTIONS_SITEMAP_LIMIT
+ changefreq = QUESTIONS_SITEMAP_CHANGEFREQ
priority = 0.5
def items(self):
return Question.objects.filter_state(deleted=False).order_by('id')