diefenbach / django-lfs

An online-shop based on Django
http://www.getlfs.com
BSD 3-Clause "New" or "Revised" License
622 stars 222 forks source link

Cache helper to delete keys #134

Closed emilian closed 10 years ago

emilian commented 10 years ago

Would it be cleaner to add a helper method in lfs.cache.utils to delete a key from the cache? Right now there is a lot of boilerplate in the code:

cache_key = "%s-%s-%s" % (settings.CACHE_MIDDLEWARE_KEY_PREFIX, Order.__name__.lower(), order.pk)
    cache.delete(cache_key)

We could change it to:

lfs_delete_cache_key(order)

Feedback?

pigletto commented 10 years ago

Such clause is used once in the code (or I miss something). Is there really a reason to have it as a helper function?

diefenbach commented 10 years ago

I agree to pigletto. I don't think we need that. Thanks anyway!

emilian commented 10 years ago

I agree with pigletto as well. I thought the clause was being used a lot more times than it actually was.