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

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)

            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 delete is failed, '
                          'Invalid value was inputed '
                          '- %s=%s, error=%s') % (model_name, model_id, ''.join(ui)))
            raise KaresansuiDBException(('Data to delete is failed, '
                          'Invalid value was inputed. '
                          '- %s=%s, error=%s') % (model_name, model_id, ''.join(ui)))

        num = len(session.deleted)
        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 delete is succeeded. - %s=%s' % (model_name, model_id))
        return num
        


src/k/a/karesansui-HEAD/karesansui/gadget/guestreplicate.py   karesansui(Download)
from karesansui.db.access._2pysilhouette import jg_save, jg_delete
from karesansui.db.model._2pysilhouette import Job, JobGroup
from karesansui.db.access.machine import \
     findbyhost1guestall, findbyhost1, \
     findbyguest1, \
 
        try:
            m_delete(obj.orm, _guest)
            obj.orm.commit()
            obj.logger.error('#3 Rollback successful. - guest id=%d' % _guest.id)
        # rollback(machine, jobgroup)
        try:
            m_delete(obj.orm, _guest)
            obj.orm.commit()
        except:

src/k/a/karesansui-HEAD/karesansui/gadget/guest.py   karesansui(Download)
from karesansui.lib.merge import  MergeGuest, MergeHost
 
from karesansui.db.access.machine import \
     findbyhost1guestall, findbyhost1, \
     findbyguest1, \
 
        try:
            m_delete(obj.orm, _guest)
            obj.orm.commit()
            obj.logger.error('#3 Rollback successful. - guest id=%d' % _guest.id)
        # rollback(machine, jobgroup)
        try:
            m_delete(obj.orm, _guest)
            obj.orm.commit()
        except:

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

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