【发布时间】:2014-05-01 21:56:34
【问题描述】:
我正在使用 web2py 创建一个页面,在该页面中我根据标题/作者/关键字/等搜索书籍。和 ISBN,我似乎无法弄清楚如何在 webapp 中使用 isbntools。我确定这是我错过的基本内容,但这是我创建的第一个 web 应用程序,它是用于一个类项目的。这是我的控制器的相关部分:
from isbntools import *
def index():
form=SQLFORM.factory(
Field('title',label='Try entering a title:'),
Field('author',label='Or an author:'),
Field('ISBN',label='Even better if you have the ISBN'),
Field('fromDate',label='When is the earliest the book might have come out?'),
Field('toDate',label='...and the latest?'))
if form.process().accepted:
titledata = isbn_goom form.vars.title bibtex
authordata = isbn_goom form.vars.author bibtex
isbndata = isbn_meta merge form.vars.ISBN bibtex
print(titledata)
print(authordata)
print(isbndata)
return dict(form=form)
这是我要返回的部分机票信息:
“Bibbly”的错误单 票号
96.255.27.81.2014-05-01.21-50-27.f66e0b53-b5bd-4621-8dbd-b6f30e8a6af1 无效语法(default.py,第 21 行) 版本 web2py™ 版本 2.8.2-stable+timestamp.2013.11.28.13.54.07 Python Python 2.7.5+:/usr/local/bin/uwsgi(前缀:/usr) 追溯
第 21 行 titledata = isbn_goom "form.vars.title" bibtex ^ SyntaxError: 无效语法
【问题讨论】: