예제 #1
0
파일: util.py 프로젝트: keizo/kulu
 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)
예제 #2
0
파일: db.py 프로젝트: cclauss/infogami
    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()
예제 #3
0
 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()
예제 #4
0
파일: session.py 프로젝트: jpsp1/mygames
    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
예제 #5
0
파일: session.py 프로젝트: jpsp1/mygames
    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
예제 #6
0
파일: db.py 프로젝트: EdwardBetts/infogami
    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()
예제 #7
0
파일: mro.py 프로젝트: benhoyt/mro
 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)
예제 #8
0
파일: node.py 프로젝트: keizo/kulu
 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')
예제 #9
0
파일: util.py 프로젝트: keizo/kulu
 def __delitem__(self, key):
     try:
         web.delete(self.table,where=self.index+'=$key',vars=locals())
     except KeyError, k:
         raise AttributeError, k
예제 #10
0
 def setUp(self):
     web.config.db_parameters = self.parameters
     #web.config.db_printing = True
     web.load()
     web.delete("test", where="1=1")
예제 #11
0
파일: test.py 프로젝트: jpsp1/mygames
 def setUp(self):
     web.config.db_parameters = self.parameters
     #web.config.db_printing = True
     web.load()
     web.delete("test", where="1=1")
예제 #12
0
파일: db.py 프로젝트: 10sr/jottit
def delete_revision(page_id, revision):
    web.delete('revisions', where='page_id=$page_id AND revision=$revision', vars=locals())
예제 #13
0
 def POST(self):
     i = web.input()
     web.debug(i)
     for item in i:
         web.delete('bookmarks', 'id = '+item)
     web.seeother('./#')
예제 #14
0
파일: db.py 프로젝트: 10sr/jottit
def delete_draft(page_id):
    web.delete('drafts', where='page_id=$page_id', vars=locals())
예제 #15
0
파일: generic.py 프로젝트: keizo/kulu
def node_delete(node):
    web.delete('node_revisions', where='nid=$node.nid', vars=locals())
예제 #16
0
 def POST(self):
     i = web.input()
     web.debug(i)
     for item in i:
         web.delete("bookmarks", "id = " + item)
     web.seeother("./#")
예제 #17
0
파일: pm.py 프로젝트: dalinhuang/demodemo
 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_)})