I think is a bug, please report it:
http://code.google.com/p/web2py/issues/list

2011/9/7 Jim Steil <[email protected]>

>  Hi
>
> I'm getting the following:
>
> Traceback (most recent call last):
>   File "C:\dev\trunk\web2py\gluon\restricted.py", line 194, in restricted
>     exec ccode in environment
>   File "C:/dev/trunk/web2py/applications/FoodPantry/controllers/default.py" 
> <http://192.168.1.171:8000/admin/default/edit/FoodPantry/controllers/default.py>,
>  line 25, in <module>
>   File "C:\dev\trunk\web2py\gluon\globals.py", line 145, in <lambda>
>     self._caller = lambda f: f()
>   File "C:/dev/trunk/web2py/applications/FoodPantry/controllers/default.py" 
> <http://192.168.1.171:8000/admin/default/edit/FoodPantry/controllers/default.py>,
>  line 21, in persons
>     form = SQLFORM.grid(db.person, ui='jquery-ui', paginate=20)
>   File "C:\dev\trunk\web2py\gluon\sqlhtml.py", line 1655, in grid
>     id = row[field_id]
>   File "C:\dev\trunk\web2py\gluon\dal.py", line 3832, in __getitem__
>     return dict.__getitem__(self, m.group(1))[m.group(2)]TypeError: 'Set' 
> object is unsubscriptable
>
>
> with the the following setup:
>
> db.py
> person = db.define_table('person',
>     Field('personId', 'id'),
>     Field('firstName', length=25, required=True, label='First Name'),
>     Field('lastName', length=25, required=True, label='Last Name'),
>     Field('address', 'text'),
>     Field('city', length=30),
>     Field('state', length=2),
>     Field('zipCode', length=10, label='ZIP Code'),
>     Field('phone', length=25),
>     Field('dob', 'date', label='Date of Birth'),
>     Field('sex', length=1),
>     Field('disability', length=50),
>     Field('singleParent', 'boolean', default=False, label='Single Parent'),
>     Field('healthInsurance', length=50, label='Health Insurance'),
>     Field('origin', length=50),
>     Field('headOfHousehold', 'reference person', label='Head of
> Household'),
>     Field('lastFirst', compute=lambda u: '%s, %s' % (u['lastName'],
>                                                      u['firstName'])))
> person.firstName.requires = IS_NOT_EMPTY()
> person.lastName.requires = IS_NOT_EMPTY()
> person.dob.requires = IS_DATE()
> person.sex.requires = IS_IN_SET(['M', 'F'])
> person.headOfHousehold.requires = IS_EMPTY_OR(IS_IN_DB(db, db.person,
>                                                       '%(lastFirst)s',
>                                                       zero='...choose
> one...'))
>
> default.py
>
> def persons():
>     form = SQLFORM.grid(db.person, ui='jquery-ui', paginate=20)
>
>     return dict(form=form)
>
> Any thoughts?
>
>     -Jim
>
>
>


-- 
 http://martin.tecnodoc.com.ar

Reply via email to