From 0642024f6db477d79ba151c8952181668d43b175 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 17 Jun 2010 21:33:43 -0400 Subject: fixed bug in migration 0014, added simple caching to template questions.html --- .../0014_rename_schema_from_forum_to_askbot.py | 24 +++++++++++----------- askbot/models/__init__.py | 2 +- askbot/setup_templates/settings.py | 3 +++ askbot/setup_templates/urls.py | 2 +- askbot/skins/default/templates/questions.html | 3 +++ askbot/skins/loaders.py | 1 - setup.py | 2 +- 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 %}