Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(3)  |  Derive(0)  |  Import(3)

            def wrapper(*args, **kwargs):
        logger = logging.getLogger('karesansui.db.access')
        session = args[0]
        model = args[1]
        model_name = get_model_name(model)
        model_id = model.id
        try:
            func(*args, **kwargs)
        except UnmappedInstanceError, ui:
            logger.error(('Data to update is failed, '
                          'Invalid value was inputed '
                          '- %s=%s, error=%s') % (model_name, model_id, ''.join(ui)))
            raise KaresansuiDBException(('Data to update is failed, '
                          'Invalid value was inputed. '
                          '- %s=%s, error=%s') % (model_name, model_id, ''.join(ui)))
        
        num = len(session.dirty)
        if not num:
            logger.warn('Data has not been changed. - %s=%s' %  (model_name, model_id))
            return num  # The return value assume zero
        
        logger.debug('Data to update is succeeded. - %s=%s' % (model_name, model_id))
        return num
        


src/k/a/karesansui-HEAD/karesansui/gadget/hostby1.py   karesansui(Download)
import karesansui
from karesansui.lib.rest import Rest, auth
from karesansui.db.access.machine import \
     findbyhost1, findby1name, findby1hostname, \
     update as m_update, delete as m_delete, logical_delete
        host.modified_user = self.me
 
        m_update(self.orm, host)
 
        return web.seeother(web.ctx.path)

src/k/a/karesansui-HEAD/karesansui/gadget/guestby1.py   karesansui(Download)
from karesansui.lib.merge import MergeGuest
 
from karesansui.db.access.machine import \
     findbyguest1, findby1name, logical_delete, \
     update as m_update, delete as m_delete
        guest.modified_user = self.me
 
        m_update(self.orm, guest)
        return web.seeother(web.ctx.path)
 

src/k/a/karesansui-HEAD/karesansui/gadget/host.py   karesansui(Download)
    USER_MIN_LENGTH, USER_MAX_LENGTH
 
from karesansui.db.access.machine import \
     findbyhostall, findby1uniquekey, findby1hostname, \
     new as m_new, save as m_save, update as m_update
            model.tags = _tags
            model.is_deleted = False
            m_update(self.orm, model)
            return web.created(None)