has the cat_id field been a "string" before being a reference in a sqlite database? If yes, you need to delete the column data and re-fill it.
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Gotchas On Wednesday, October 30, 2013 4:55:50 PM UTC+1, Gael Princivalle wrote: > > Hi. > > I've got a strange error. > > My db: > db.define_table('models', > Field('code', unique=True), > Field('category'), > Field('cat_id', 'reference categories'), > Field('description_en'), > Field('description_it'), > Field('pdf_path')) > db.define_table('images', > Field('title_en'), > Field('title_it'), > Field('contents'), > Field('image_file', 'upload'), > Field('image_file_s', 'upload')) > > When I do a beautify on the "images" table in the same view, it works. > With the "models table", I've got this error: > invalid literal for long() with base 10: 'ie' > > My controller: > def hp(): > models=db().select(db.models.ALL) > return dict(models=models) > > My view: > {{=BEAUTIFY(response._vars)}} > > I use this "models" table also with a Grid and it works. > > What's wrong ? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.