示例#1
0
 def get_user(cls, id):
     conditions = {"id": id} if id else None
     s = ModelUtil.query_many(map_name, table_name, conditions, {'_id': 0})
     return s
示例#2
0
 def create_user(cls, data):
     u = list(ModelUtil.query_many(map_name, table_name))
     data['id'] = int(u[len(u) - 1]['id']) + 1
     item = ModelUtil.create(map_name, table_name, data)
     item.pop("_id")
     return item