def _get(model, condition=None): r = db.query(model).filter(condition) return r.all() if r.count() else None
def _get_one(model, condition): r = db.query(model).filter(condition) return r.one() if r.count() else None