Beispiel #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)
Beispiel #2
0
 def explicit_staticmethod_select_one(context=None, **kwargs):
     return sql.select_one(context.users, **kwargs)
Beispiel #3
0
 def method_select_one(self, context=None, **kwargs):
     return sql.select_one(context.users, **kwargs)
Beispiel #4
0
def fancy_bound_select_one(context=None, **kwargs):
    return sql.select_one(context.users, **kwargs)
Beispiel #5
0
def decorated_bound_select_one(context=None, **kwargs):
    return sql.select_one(context.users, **kwargs)
Beispiel #6
0
def select_one(context=None, **kwargs):
    return sql.select_one(context.users, **kwargs)
Beispiel #7
0
 def find_by_id(user_id, context=None):
     return sql.select_one(context.users, id=user_id)
Beispiel #8
0
 def filter_by(context=None, **filters):
     return sql.select_one(context.users, **filters)
Beispiel #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)