Пример #1
0
 def last(cls, num: int = 0) -> dict or list:
     if num == 0:
         return Expr(cls).operator.order(field_name_created_at,
                                         desc=True).findone()
     else:
         return Expr(cls).operator.order(field_name_created_at,
                                         desc=True).limit(num).find()
Пример #2
0
 def take(cls, num: int = 0) -> dict or list:
     if num == 0:
         return Expr(cls).operator.findone()
     else:
         return Expr(cls).operator.limit(num).find()
Пример #3
0
 def create(cls):
     return Expr(cls).operator.create()
Пример #4
0
 def drop(cls):
     return Expr(cls).operator.drop()
Пример #5
0
 def new(cls, **kwargs):
     return Expr(cls, **kwargs)
Пример #6
0
 def add(cls, **kwargs):
     return Expr(cls, **kwargs).operator.insert()
Пример #7
0
 def where(cls, **kwargs):
     return Expr(cls, **kwargs).operator