def get_project_raw(project_id): try: project = Project.get(project_id) except StatementError: raise ProjectNotFoundException() if project is None: raise ProjectNotFoundException() return project
def get_project_raw(project_id): """ Get project matching given id, as active record. Raises an exception if project is not found. """ try: project = Project.get(project_id) except StatementError: raise ProjectNotFoundException() if project is None: raise ProjectNotFoundException() return project
def get_project_by_name(project_name): project = Project.get_by(name=project_name) if project is None: raise ProjectNotFoundException() return project.serialize()
def get_project_by_name(project_name): """ Get project matching given name. Raises an exception if project is not found. """ project = Project.query.filter(Project.name.ilike(project_name)).first() if project is None: raise ProjectNotFoundException() return project.serialize()