def get_all(): df = crud.all() return df.to_json(orient='records')
def incomes_by_user(): try: return crud.all("income") except: return response_error()
def list_entity(resource): resource_class = get_resource_class(resource) return response_success(params={"data":crud.all(resource_class, request=request)})
def expenses_by_tag(tag): try: tag_id = Tag.get(name=tag)['_id'] return response_success(params={'data':crud.all("expense", tag_id=tag_id)}) except: return response_error()