I´m a newbie trying to learn how to use SQLFORM.factory. I´ve created
the followiing controller:

@auth.requires_login()
def teste():
    form =
SQLFORM.factory(Field('arquivo',widget=SQLFORM.widgets.radio.widget,requires=IS_IN_SET['mpconsumida':'mpconsumida.csv','produtovendido':'produtovendido.csv']))
    return locals()

The view, teste.html is:

{{extend 'layout.html'}}
<h1>Teste de seleção</h1>
{{=response.toolbar()}}
{{=BEAUTIFY(response._vars)}}
{{=form}}

But it is giving the the follwing error:

<type 'exceptions.TypeError'> 'type' object is unsubscriptable

Traceback (most recent call last):
  File "gluon/restricted.py", line 204, in restricted
  File "C:/Users/Ciro/Desktop/Web2py/applications/prods/controllers/
default.py", line 63, in <module>
  File "gluon/globals.py", line 172, in <lambda>
  File "gluon/tools.py", line 2533, in f
  File "C:/Users/Ciro/Desktop/Web2py/applications/prods/controllers/
default.py", line 60, in teste
TypeError: 'type' object is unsubscriptable

Line 60 is the SQLFORM line.

I see no error. Can anyone help me?
Thanks
Ciro

Reply via email to