simple error on QLFORM.factory

16 views
Skip to first unread message

António Ramos

unread,
May 12, 2022, 11:26:17 AMMay 12
to web...@googlegroups.com

Hello

Just trying to teach someone some web2py stuff from the web2py book and i got stuck at the beginning.
My friend computer returns this error.
The same code in my pc is ok
def first():
    form = SQLFORM.factory(Field('visitor_name',
                                 label='what is your name?',
                                 requires=IS_NOT_EMPTY()))


any help ?

Regards

Error ticket for "teste"

Ticket ID

127.0.0.1.2022-05-12.16-13-34.312f7acc-fcaf-4e3b-baff-b070321e1706

<class 'TypeError'> __init__() got an unexpected keyword argument 'requires'

Versão

web2py™ Version 2.22.3-stable+timestamp.2022.02.15.15.14.38
Python Python 3.8.3rc1: C:\Users\convidado\AppData\Local\Programs\Python\Python38-32\python.exe (prefix: C:\Users\convidado\AppData\Local\Programs\Python\Python38-32)

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Traceback (most recent call last):
File "C:\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
File "C:/web2py/applications/teste/controllers/teste.py", line 47, in <module>
File "C:\web2py\gluon\globals.py", line 430, in <lambda>
self._caller = lambda f: f()
File "C:/web2py/applications/teste/controllers/teste.py", line 34, in primeiro
form = SQLFORM.factory(Field('visitor_name',requires=IS_NOT_EMPTY()))
TypeError: __init__() got an unexpected keyword argument 'requires'



Dave S

unread,
May 12, 2022, 7:05:34 PMMay 12
to web2py-users
On Thursday, May 12, 2022 at 8:26:17 AM UTC-7 Ramos wrote:

Hello

Just trying to teach someone some web2py stuff from the web2py book and i got stuck at the beginning.
My friend computer returns this error.
The same code in my pc is ok
def first():
    form = SQLFORM.factory(Field('visitor_name',
                                 label='what is your name?',
                                 requires=IS_NOT_EMPTY()))


any help ?

Regards

Without more clues, the first thing I'd check is that both machines are using the same version of Python.

/dps

Dave S

unread,
May 12, 2022, 8:00:08 PMMay 12
to web2py-users
On Thursday, May 12, 2022 at 4:05:34 PM UTC-7 Dave S wrote:
On Thursday, May 12, 2022 at 8:26:17 AM UTC-7 Ramos wrote:

Hello

Just trying to teach someone some web2py stuff from the web2py book and i got stuck at the beginning.
My friend computer returns this error.
The same code in my pc is ok
def first():
    form = SQLFORM.factory(Field('visitor_name',
                                 label='what is your name?',
                                 requires=IS_NOT_EMPTY()))


any help ?

Regards

Without more clues, the first thing I'd check is that both machines are using the same version of Python.


Which perhaps should be 3.10 ....

/dps
 
Reply all
Reply to author
Forward
0 new messages