def __delitem__(self, key): if self.has_key(key): try: web.delete(self.table,where=self.key_field+'=$key',vars=locals()) except: raise dict.__delitem__(self,key)
def approve(self, url, user_id, path, revision): site_id = core.db.get_site_id(url) page_id = core.db.get_page_id(url, path) # @@ is there any better way? web.transact() try: web.delete( "review", where= "site_id=$site_id AND page_id=$page_id AND user_id=$user_id", vars=locals(), ) web.insert( "review", site_id=site_id, page_id=page_id, user_id=user_id, revision=revision, ) except: web.rollback() raise else: web.commit()
def delete(self, id, providerName): username = self.usernameProvider.get() web.transact() web.delete('places', where="providerid=%s and provider=%s" % \ (web.db.sqlquote(id), web.db.sqlquote(providerName))) web.query(self.SQL_ACTION % (web.db.sqlquote(username), web.db.sqlquote('elimino propiedad %s-%s' % (providerName, id)))); web.commit()
def remove(self, id_): '''removes session''' web.transact() try: web.delete(web.config.handler_parameters.db_table, where='id = $id', vars={'id': id_}) web.commit() except Exception, inst: web.rollback() raise inst
def clean(self, timeout): '''removes all expired sessions''' web.transact() try: web.delete(web.config.handler_parameters.db_table, where='($now - touched) >= $timeout', vars={'timeout': timeout, 'now': int(time.time())}) web.commit() except Exception, inst: web.rollback() raise inst
def approve(self, url, user_id, path, revision): site_id = core.db.get_site_id(url) page_id = core.db.get_page_id(url, path) #@@ is there any better way? web.transact() try: web.delete('review', where="site_id=$site_id AND page_id=$page_id AND user_id=$user_id", vars=locals()) web.insert('review', site_id=site_id, page_id=page_id, user_id=user_id, revision=revision) except: web.rollback() raise else: web.commit()
def delete(self, _test=False): """ Delete this row based on its primary key. >>> u = UserTest(id=5) >>> print u.delete(_test=True) DELETE FROM users WHERE id = 5 """ key_name = self._primary_key return web.delete(self._table, where='%s = $key' % key_name, vars={'key': getattr(self, key_name)}, _test=_test)
def POST(self, nid): page = self.page node = mod.node.load(nid) if node is None: pagenotfound() else: self._checkaccess(node) f = self._form_delete() if f.validates(): web.delete('node', where='nid=$node.nid', vars=locals()) # Do module specific deletes. if hasattr(mod[node.type], 'node_delete'): mod[node.type].node_delete(node) content = "okay, it's deleted" web.render('generic.html') else: content = "error: the delete from wasn't submitted correctly. weird." web.render('generic.html')
def __delitem__(self, key): try: web.delete(self.table,where=self.index+'=$key',vars=locals()) except KeyError, k: raise AttributeError, k
def setUp(self): web.config.db_parameters = self.parameters #web.config.db_printing = True web.load() web.delete("test", where="1=1")
def delete_revision(page_id, revision): web.delete('revisions', where='page_id=$page_id AND revision=$revision', vars=locals())
def POST(self): i = web.input() web.debug(i) for item in i: web.delete('bookmarks', 'id = '+item) web.seeother('./#')
def delete_draft(page_id): web.delete('drafts', where='page_id=$page_id', vars=locals())
def node_delete(node): web.delete('node_revisions', where='nid=$node.nid', vars=locals())
def POST(self): i = web.input() web.debug(i) for item in i: web.delete("bookmarks", "id = " + item) web.seeother("./#")
def delete(self, obj): #with web.transaction(): self.evil(obj) self._run_fixture(obj, 'delete') web.delete(obj._pm_db_table_, where="%s = $id" % obj._pm_id_column_, vars={'id':getattr(obj, obj._pm_id_column_)})