示例#1
0
 def delete_cache(self, playlist_id):
     limit = getSetting('pagination_limit')
     upkey = cache.make_key('/playlist/getUserPlaylists', limit=limit, 
                             offset=self.offset, user_id=api.user_id)
     pkey = cache.make_key('/playlist/get',playlist_id=playlist_id, 
         offset=self.offset, limit=limit, extra='tracks')
     cache.delete(upkey)
     cache.delete(pkey)
def clear_file_upload_cache(request):
    """
    Clears the current file upload cache for the request/view.
    """
    url = request.get_full_path()
    if ('file_upload_cache' in request.session and
        url in request.session['file_upload_cache']):
        request.session['file_upload_cache'].remove(url)
    cache.delete(request.session.session_key)
示例#3
0
 def _delete_cache(self):
     limit = getSetting('pagination_limit')
     key = cache.make_key('/favorite/getUserFavorites', 
                        user_id=api.user_id, 
                        limit=limit, 
                        offset=self.offset)
     return cache.delete(key)
示例#4
0
 def _delete_cache(self):
     limit = getSetting('pagination_limit')
     keys = []
     keys.append(cache.make_key('/favorite/getUserFavorites',
                        user_id=api.user_id,
                        limit=limit,
                        offset=self.offset))
     for kind in ['artists', 'albums', 'tracks']:
         keys.append(cache.make_key('/favorite/getUserFavorites',
                        user_id=api.user_id,
                        limit=limit,
                        type=kind,
                        offset=self.offset))
     ret = False
     for key in keys:
         if cache.delete(key):
             ret = True
     return ret
示例#5
0
	def save(self, *args, **kwargs):
		cache.delete('categories-all-cached')
		super(Category, self).save(*args, **kwargs)
示例#6
0
 def delete_cache(self):
     key = cache.make_key("/user/login", username=api.username, password=api.password)
     cache.delete(key)
示例#7
0
def replace_timer_event(event_type, cache_value, timestamp):
    key = prefix_key('timerzset:%s' % event_type)
    cache.delete(key)
    return cache.zadd(key, timestamp, cache_value)
示例#8
0
 def delete_cache(self):
     key = cache.make_key('/user/login',
                          username=api.username,
                          password=api.password)
     cache.delete(key)