On Friday, September 2, 2011 10:47:42 AM UTC-4, spyker wrote: > > On 26 August 2011 17:07, Martín Mulone <[email protected]> wrote: > >> To debug the problem, start passing one by one the fields: >> >> > The following models work: > > db.define_table('journal', > Field('title'), > Field('issn'), > Field('subject'), > Field('heading'), > ) > > db.define_table('article', > Field('title'), > Field('year'), > Field('journal', type = 'reference journal'), > Field('authors', 'list:reference')) > > and as soon as I add ', > requires = IS_IN_DB('journal_id', 'title)%s', > zero = None) > > to the field 'journal' in the table 'article' I get > > File "/home/js/web2py/applications/isi_proef/models/isi.py" > <http://localhost:8000/admin/default/edit/isi_proef/models/isi.py>, line 13, > in <module> > > zero = None)), > File "/home/js/web2py/gluon/validators.py", line 385, in __init__ > > (ktable, kfield) = str(self.field).split('.') > ValueError: need more than 1 value to unpack > > > It is a bit frustrating to guess what should be done. Is there > documentation somewhere? > > Regards > Johann > -- > May grace and peace be yours in abundance through the full knowledge of > God and of Jesus our Lord! His divine power has given us everything we need > for life and godliness through the full knowledge of the one who called us > by his own glory and excellence. > 2 Pet. 1:2b,3a > > Shouldn't it be IS_IN_DB(db, 'journal.id', ...) -- note 'journal.id' rather than 'journal_id'? Also, your list:reference has to refer to a referenced table.
Anthony

