summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-06-17 21:33:43 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-06-17 21:33:43 -0400
commit0642024f6db477d79ba151c8952181668d43b175 (patch)
tree5c8d8242c46bb8f68ef103f6705d6d9c1e6ccf54
parenta4729a2c6b5544939e5ad1447d950ff0b81cb1ac (diff)
downloadaskbot-0642024f6db477d79ba151c8952181668d43b175.tar.gz
askbot-0642024f6db477d79ba151c8952181668d43b175.tar.bz2
askbot-0642024f6db477d79ba151c8952181668d43b175.zip
fixed bug in migration 0014, added simple caching to template questions.html
-rw-r--r--askbot/migrations/0014_rename_schema_from_forum_to_askbot.py24
-rw-r--r--askbot/models/__init__.py2
-rw-r--r--askbot/setup_templates/settings.py3
-rw-r--r--askbot/setup_templates/urls.py2
-rw-r--r--askbot/skins/default/templates/questions.html3
-rw-r--r--askbot/skins/loaders.py1
-rw-r--r--setup.py2
7 files changed, 21 insertions, 16 deletions
diff --git a/askbot/migrations/0014_rename_schema_from_forum_to_askbot.py b/askbot/migrations/0014_rename_schema_from_forum_to_askbot.py
index 8af0e9d6..b79c4eb1 100644
--- a/askbot/migrations/0014_rename_schema_from_forum_to_askbot.py
+++ b/askbot/migrations/0014_rename_schema_from_forum_to_askbot.py
@@ -11,24 +11,24 @@ class Migration(SchemaMigration):
def forwards(self, orm):
try:
- db.rename_table('forum_anonymousanswer', 'forum_anonymousanswer')
- db.rename_table('forum_anonymousquestion', 'forum_anonymousquestion')
- db.rename_table('forum_emailfeedsetting', 'forum_emailfeedsetting')
- db.rename_table('forum_markedtag', 'forum_markedtag')
- db.rename_table('forum_questionview', 'forum_questionview')
- db.rename_table('forum_validationhash', 'forum_validationhash')
+ db.rename_table('forum_anonymousanswer', 'askbot_anonymousanswer')
+ db.rename_table('forum_anonymousquestion', 'askbot_anonymousquestion')
+ db.rename_table('forum_emailfeedsetting', 'askbot_emailfeedsetting')
+ db.rename_table('forum_markedtag', 'askbot_markedtag')
+ db.rename_table('forum_questionview', 'askbot_questionview')
+ db.rename_table('forum_validationhash', 'askbot_validationhash')
except:
pass
def backwards(self, orm):
if app_dirname == 'forum':
- db.rename_table('forum_anonymousanswer', 'forum_anonymousanswer')
- db.rename_table('forum_anonymousquestion', 'forum_anonymousquestion')
- db.rename_table('forum_emailfeedsetting', 'forum_emailfeedsetting')
- db.rename_table('forum_markedtag', 'forum_markedtag')
- db.rename_table('forum_questionview', 'forum_questionview')
- db.rename_table('forum_validationhash', 'forum_validationhash')
+ db.rename_table('askbot_anonymousanswer', 'forum_anonymousanswer')
+ db.rename_table('askbot_anonymousquestion', 'forum_anonymousquestion')
+ db.rename_table('askbot_emailfeedsetting', 'forum_emailfeedsetting')
+ db.rename_table('askbot_markedtag', 'forum_markedtag')
+ db.rename_table('askbot_questionview', 'forum_questionview')
+ db.rename_table('askbot_validationhash', 'forum_validationhash')
if app_dir_name == 'forum':
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py
index eb8d0185..3f3a8b07 100644
--- a/askbot/models/__init__.py
+++ b/askbot/models/__init__.py
@@ -323,7 +323,7 @@ def send_instant_notifications_about_activity_in_post(
[user.email]
)
#msg.send()
- print text
+ #print text
EMAIL_UPDATE_ACTIVITY = const.TYPE_ACTIVITY_EMAIL_UPDATE_SENT
email_activity = Activity(
user = user,
diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py
index aa6194aa..d3bf3d9e 100644
--- a/askbot/setup_templates/settings.py
+++ b/askbot/setup_templates/settings.py
@@ -155,6 +155,9 @@ INSTALLED_APPS = (
#setup memcached for production use!
#see http://docs.djangoproject.com/en/1.1/topics/cache/ for details
CACHE_BACKEND = 'locmem://'
+#needed for django-keyedcache
+CACHE_TIMEOUT = 6000
+CACHE_PREFIX = 'askbot' #make this unique
#If you use memcache you may want to uncomment the following line to enable memcached based sessions
#SESSION_ENGINE = 'django.contrib.sessions.backends.cache_db'
diff --git a/askbot/setup_templates/urls.py b/askbot/setup_templates/urls.py
index 31895b99..b9206308 100644
--- a/askbot/setup_templates/urls.py
+++ b/askbot/setup_templates/urls.py
@@ -10,7 +10,7 @@ admin.autodiscover()
urlpatterns = patterns('',
(r'^%s' % settings.FORUM_SCRIPT_ALIAS, include('askbot.urls')),
(r'^admin/', include(admin.site.urls)),
- (r'^cache/', include('keyedcache.urls')),
+ #(r'^cache/', include('keyedcache.urls')), - broken views disable for now
(r'^settings/', include('askbot.deps.livesettings.urls')),
)
diff --git a/askbot/skins/default/templates/questions.html b/askbot/skins/default/templates/questions.html
index 1988f0cb..9e6116f8 100644
--- a/askbot/skins/default/templates/questions.html
+++ b/askbot/skins/default/templates/questions.html
@@ -5,6 +5,7 @@
{% load humanize %}
{% load extra_filters %}
{% load smart_if %}
+{% load cache %}
{% block title %}{% spaceless %}{% trans "Questions" %}{% endspaceless %}{% endblock %}
{% block forejs %}
<script type="text/javascript">
@@ -185,7 +186,9 @@
</div>
{% endif %}
<div id="listA">
+{% cache 600 questions search_tags scope sort query %}
{% include "question_list.html" %}
+{% endcache %}
{% comment %}todo: fix css here{% endcomment %}
{% if questions_count == 0 %}
{% comment %}todo: add tips to widen selection{% endcomment%}
diff --git a/askbot/skins/loaders.py b/askbot/skins/loaders.py
index b95f7f1f..23f0026b 100644
--- a/askbot/skins/loaders.py
+++ b/askbot/skins/loaders.py
@@ -26,7 +26,6 @@ def load_template_source(name, dirs=None):
return filesystem.load_template_source(tname,dirs)
except:
tname = os.path.join('default','templates',name)
- print tname
return filesystem.load_template_source(tname,dirs)
load_template_source.is_usable = True
diff --git a/setup.py b/setup.py
index 07ebec81..1fc5bc02 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ if sys.platform not in WIN_PLATFORMS:
setup(
name = "askbot",
- version = "0.6.2",
+ version = "0.6.3",
description = 'Question and Answer forum, like StackOverflow, written in python and Django',
packages = find_packages(),
author = 'Evgeny.Fadeev',