Exemplo n.º 1
0
 def new(self, context=None, **kwargs):
     try:
         row_id = self.insert(kwargs, context=context)
     except IntegrityError as e:
         if self.verbose:
             self.logger.error('new: integrity error in %s -> %s (%s)'
                               % (self.table, repr(kwargs), repr(e)))
         return None
     except BaseException as e:
         if self.verbose:
             self.logger.error('new: unknown error in %s -> %s (%s)'
                               % (self.table, repr(kwargs), repr(e)))
         return None
     table = self.get(context=context)
     return sql.select_one(table, id=row_id)
Exemplo n.º 2
0
 def explicit_staticmethod_select_one(context=None, **kwargs):
     return sql.select_one(context.users, **kwargs)
Exemplo n.º 3
0
 def method_select_one(self, context=None, **kwargs):
     return sql.select_one(context.users, **kwargs)
Exemplo n.º 4
0
def fancy_bound_select_one(context=None, **kwargs):
    return sql.select_one(context.users, **kwargs)
Exemplo n.º 5
0
def decorated_bound_select_one(context=None, **kwargs):
    return sql.select_one(context.users, **kwargs)
Exemplo n.º 6
0
def select_one(context=None, **kwargs):
    return sql.select_one(context.users, **kwargs)
Exemplo n.º 7
0
 def find_by_id(user_id, context=None):
     return sql.select_one(context.users, id=user_id)
Exemplo n.º 8
0
 def filter_by(context=None, **filters):
     return sql.select_one(context.users, **filters)
Exemplo n.º 9
0
 def ifilter_by(self, operator=and_, context=None, **filters):
     table = self.get(context=context)
     return sql.select_one(table, where=sql.iwhere,
                           operator=operator, **filters)