from django.core.cache import cache
from hashlib import md5
from django.utils.http import urlquote

#modified from http://djangosnippets.org/snippets/1593/
def expireTemplateCache(fragment_name, *variables):
    args = md5(u':'.join([urlquote(unicode(x)) for x in variables]))
    cache_key = 'template.cache.%s.%s' % (fragment_name, args.hexdigest())
    cache.delete(cache_key)

def authStatus(user):
    if 'is_authenticated' in dir(user):
        return user.is_authenticated()
    else:
        return str(user)

@@ -9,22 +9,16 @@
 ngo.core
-.cache
  import 
@@ -27,152 +27,155 @@
 che%0A
-from hashlib import md5%0Afrom django.utils.http import urlquote%0A%0A#modified from http://djangosnippets.org/snippets/1593/%0Adef expireT
+%0Adef expireTemplateCache(fragment_name, *variables):%0A    # At this point you should probably just call%0A    # django.core.cache.utils.make_t
 emplate
-Cache(
+_
 frag
@@ -183,137 +183,143 @@
 ent_
-name, *variables):%0A    args = md5(u':'.join(%5Burlquote(unicode(x)) for x in variables%5D))%0A    cache_key = 'template.cache.%25s.%25s' %25 
+key directly, but for%0A    # compatibility we include the following convenience method.%0A    key = cache.utils.make_template_fragment_key
 (fra
@@ -334,30 +334,29 @@
 me, 
+v
 ar
-gs.hexdigest()
+iables
 )%0A    
+cache.
 cach
@@ -368,14 +368,8 @@
 ete(
-cache_
 key)

Update expireTemplateCache for 1.6.