def post(self): project_name = request.form['project_name'] project = Project() project.project_name = project_name db.session.add(project) db.session.commit() return project.to_dict()
def project_create(): project_name = request.form['project_name'] project = Project() project.project_name = project_name db.session.add(project) db.session.commit() return redirect("/project/%s/spider/deploy" % project.id, code=302)
def get_project_list(self): data = request("get", self._scrapyd_url() + "/listprojects.json", return_type="json") result = [] if data: for project_name in data['projects']: project = Project() project.project_name = project_name result.append(project) return result