comparison gpp/news/admin.py @ 213:65016249bf35

See #31; undid attempts to clear template tag caching when saving news and bulletins, as we don't know the cache key (it is mangled).
author Brian Neal <bgneal@gmail.com>
date Mon, 10 May 2010 02:58:19 +0000
parents b4305e18d3af
children 6dbb8faef085
comparison
equal deleted inserted replaced
212:fad7548b7f6e 213:65016249bf35
3 """ 3 """
4 import datetime 4 import datetime
5 5
6 from django.contrib import admin 6 from django.contrib import admin
7 from django.conf import settings 7 from django.conf import settings
8 from django.core.cache import cache
9 8
10 from news.models import PendingStory 9 from news.models import PendingStory
11 from news.models import Story 10 from news.models import Story
12 from news.models import Category 11 from news.models import Category
13 12
29 date_submitted=datetime.datetime.now(), 28 date_submitted=datetime.datetime.now(),
30 allow_comments=pending_story.allow_comments, 29 allow_comments=pending_story.allow_comments,
31 tags=pending_story.tags) 30 tags=pending_story.tags)
32 story.save() 31 story.save()
33 pending_story.delete() 32 pending_story.delete()
34 cache.delete('home_news')
35 33
36 approve_story.short_description = "Approve selected pending stories" 34 approve_story.short_description = "Approve selected pending stories"
37 35
38 class Media: 36 class Media:
39 js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] 37 js = settings.GPP_THIRD_PARTY_JS['tiny_mce']