Re: How to delete template fragment cache?

2008-12-03 Thread Nathaniel Whiteinge

On Dec 3, 12:37 am, Bartek SQ9MEV <[EMAIL PROTECTED]> wrote:
> I know I should use cache.delete('a'), but how can I get key for
> particular fragment?

The key is 'fragment_name:additional:arguments:seperated:by:colons'.

> What is better idea? Use signals (I do not know too mouch about them
> yet)or just overwrite model_save method?

It doesn't really matter. Signals are most useful, IMO, for tying
behavior to events that happen in apps you don't control (3rd-party,
contrib, etc.).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to delete template fragment cache?

2008-12-02 Thread Bartek SQ9MEV

Hi all, I'm quite newbie in Django.
I use template fragment caching ({% cache ...%}...{% endcache %}. This
fragment changes rather seldom, changes originate only from admin site,
są for me its obvious to delete cache at adding objects from admin, and
use quite large tiemeout for my caches.

How can I delete cache for particular fragments at saving objects?

I know I should use cache.delete('a'), but how can I get key for
particular fragment?

What is better idea? Use signals (I do not know too mouch about them
yet)or just overwrite model_save method?

I use memcached backend.
-- 
Pozdrawiam
Bartek
jid: [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---