コントローラーにクエリコードを書いています:
books=db(db.book.lib_name=="My-Library-Name").select(db.book.title, db.book.ISBN, orderby=db.book.title)
しかし、私はこのエラーを受け取り続けます:
<type 'exceptions.ValueError'> invalid literal for long() with base 10: "My-Library-Name"
これは私の DAL データベースです (データベース ドライバーとして postgresql を使用しています):
db = DAL('postgres://myUsername:myPassword@localhost/libman',pool_size=0)
db.define_table('library',
Field('lib_name', ondelete='CASCADE', unique=True),
Field('address', length=20),
primarykey=['lib_name'])
db.define_table('book',
Field('ISBN', unique=True, ondelete='CASCADE'),
Field('lib_name', 'reference library'),
Field('pic', 'upload'),
Field('title', length=100),
Field('publisher_lname', length=50),
Field('publisher_fname', length=50),
Field('no_of_copies', 'integer'),
Field('available_copies', 'integer'),
Field('description', length=255),
primarykey=['ISBN'])
返信ありがとうございます