On 17 November 2010 16:48, mdipierro <mdipie...@cs.depaul.edu> wrote:

> IS_IN_DB(...,orderby=...)
>
>
Thanks.  Now I get

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.

Traceback (most recent call last):
  File "/home/js/web2py/gluon/restricted.py", line 188, in restricted
    exec ccode in environment
  File "/home/js/web2py/applications/init/models/kb5.py"
<http://127.0.0.1:8000/admin/default/edit/init/models/kb5.py>, line
189, in <module>
    orderby = 'instansie.naam' )),
  File "/home/js/web2py/gluon/validators.py", line 368, in __init__
    (ktable, kfield) = str(self.field).split('.')
ValueError: need more than 1 value to unpack

 Error snapshot [image: help] Detailed traceback description

<type 'exceptions.ValueError'>(need more than 1 value to unpack)


The model:




db.define_table('instansie_nuwename',
                Field('nuutste', db.instansie,
                      requires = IS_IN_DB(db, 'instansie.id','%(naam)s',
orderby = 'instansie.naam' )),
                Field('vorige', 'list:reference instansie',
                      requires = IS_IN_DB('instansie.id','%(naam)s',multiple
= True,
                                          orderby = 'instansie.naam' )),
                Field('jaar', label = 'Tot watter jaar?'),
                signature)
db.instansie_nuwename.nuutste.represent = lambda id: db.instansie(id).naam


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

Reply via email to