Beispiel #1
0
 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)))
Beispiel #2
0
 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  # If you do not flush the session, Unable to retrieve the model id.
     try:
         func(*args, **kwargs)
     except UnmappedInstanceError, ui:
         logger.error(('Data to insert is failed, '
                       'Invalid value was inputed. '
                       '- %s=%s, error=%s') % (model_name, model_id, ''.join(ui)))
         raise KaresansuiDBException(('Data to insert is failed, '
                       'Invalid value was inputed. '
                       '- %s=%s, error=%s') % (model_name, model_id, ''.join(ui)))