def memcached_path(self, path='all', **post): return memcached.get_flush_page(memcached.get_keys(path=path), 'Cached Pages Path %s' % path, '/mcpath?path=%s' % path, '/mcpath/delete?path=%s' % path)
def remove_cached_page(self, url='', **kw): memcached.mc_delete(memcached.get_keys(flush_type='page', path=url)) return 'deleted'
def memcached_module(self, module='all', **post): return memcached.get_flush_page(memcached.get_keys(module=module), 'Cached Pages Model %s' % module, '/mcmodule/%s' % module, '/mcmodule/%s/delete' % module)
def memcached_etag(self, etag='all', **post): return memcached.get_flush_page( memcached.get_keys(etag=etag, load=True), 'Cached Pages Etag %s' % etag, '/mcetag/%s' % etag, '/mcetag/%s/delete' % etag)
def mc_delete_path(self,res_id): model_data = self.env['ir.model.data'].search([('model','=','ir.ui.view'),('res_id','=',res_id)],limit=1) if model_data and model_data.module == 'website': for key in memcached.get_keys(path='/page/%s' % model_data.name, db=self._cr.dbname): memcached.mc_delete(key)
def memcached_clear_path(self, path='all', **post): memcached.mc_delete(memcached.get_keys(path=path)) return request.redirect(path, code=302)
def memcached_flush(self, flush_type='all', **post): return memcached.get_flush_page( memcached.get_keys(flush_type=flush_type, load=True), 'Cached Pages %s' % flush_type, '/mcflush/%s' % flush_type, '/mcflush/%s/delete' % flush_type)
def memcached_status_code_delete(self, status_code='all', **post): memcached.mc_delete(memcached.get_keys(status_code=status_code)) return werkzeug.utils.redirect('/mcstatus/%s' % status_code, 302)
def memcached_status_code(self, status_code='all', **post): return memcached.get_flush_page( memcached.get_keys(status_code=status_code, load=True), 'Cached Pages Status %s' % status_code, '/mcstatus/%s' % status_code, '/mcstatus/%s/delete' % status_code)
def memcached_path_delete(self, path='all', **post): memcached.mc_delete(memcached.get_keys(path=path)) return werkzeug.utils.redirect('/mcpath?path=%s' % path, 302)
def memcached_module_delete(self, module='all', **post): memcached.mc_delete(memcached.get_keys(module=module)) return werkzeug.utils.redirect('/mcmodule/%s' % module, 302)
def memcached_flush_delete(self, flush_type='all', **post): memcached.mc_delete(memcached.get_keys(flush_type=flush_type)) return werkzeug.utils.redirect('/mcflush/%s' % flush_type, 302)