did you try removing one Field at a time inside SQLFORM.factory and see 
where the errors pops up ?

On Wednesday, November 7, 2012 2:58:10 PM UTC+1, Wouter Pronk wrote:
>
> Did some other testing and found simular error on this controler:
> def add_relatie():
>     adres = db.executesql('SELECT adressen.relatie_nummer, " | ", 
> adressen.relatie_code, " | ", adressen.relatie_naam FROM adressen left join 
> edirelaties on adressen.relatie_nummer = edirelaties.relatie_nummer WHERE 
> edirelaties.relatie_nummer is null;')
>     form = SQLFORM.factory(
>         Field('relatie_nummer', requires=IS_IN_SET([a[0] for a in 
> adres],labels
> =[a for a in adres])),
>         Field('login_naam', requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db, 
> 'edirelaties.login_naam'),IS_ALPHANUMERIC(error_message='must be 
> alphanumeric!')]),
>         Field('password', requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db, 
> 'edirelaties.password'),IS_ALPHANUMERIC(error_message='must be 
> alphanumeric!')]),
>         Field('work_directory', requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db, 
> 'edirelaties.work_directory'),IS_ALPHANUMERIC(error_message='must be 
> alphanumeric!')]))
>     if form.process().accepted:
>         db.edirelaties.insert(**form.vars)
>         response.flash = 'Your new edirelatie has been added'
>         redirect(URL('show', args=form.vars.id))
>     elif form.errors:
>         response.flash = 'form has errors'
>     return dict(form=form)
> Any idea?
>
>
> Op woensdag 7 november 2012 12:42:58 UTC+1 schreef Niphlod het volgende:
>>
>> did you try with trunk ?
>>
>> On Wednesday, November 7, 2012 12:38:40 PM UTC+1, Wouter Pronk wrote:
>>>
>>> I just did and it did go in exception. Is my web2py corrupt?
>>>
>>> Op woensdag 7 november 2012 12:17:32 UTC+1 schreef Niphlod het volgende:
>>>>
>>>> create a fresh app and paste your code in it. It shouldn't go in 
>>>> exception
>>>>
>>>> form = SQLFORM.factory(
>>>>             Field('relatie_id', writable=False, readable=False),
>>>>             Field('relatie_nummer', writable=False, readable=False),
>>>>             Field('direction', writable=False, readable=False),
>>>>             Field('protocol', writable=False, readable=False),
>>>>             Field('email', requires=IS_EMAIL())
>>>> )
>>>>
>>>>
>>>>
>>>> This doesn't
>>>>
>>>> On Wednesday, November 7, 2012 12:12:24 PM UTC+1, Wouter Pronk wrote:
>>>>>
>>>>> Hello Niphlod,
>>>>> this is the traceback:
>>>>>
>>>>> Traceback (most recent call last):
>>>>>   File "/home/wouter/Web2py/web2py/gluon/restricted.py", line 212, in 
>>>>> restricted
>>>>>     exec ccode in environment
>>>>>   File 
>>>>> "/home/wouter/Web2py/web2py/applications/edirelaties/controllers/default.py"
>>>>>  
>>>>> <http://127.0.0.1:8000/admin/default/edit/edirelaties/controllers/default.py>,
>>>>>  line 381, in <module>
>>>>>   File "/home/wouter/Web2py/web2py/gluon/globals.py", line 188, in 
>>>>> <lambda>
>>>>>     self._caller = lambda f: f()
>>>>>   File 
>>>>> "/home/wouter/Web2py/web2py/applications/edirelaties/controllers/default.py"
>>>>>  
>>>>> <http://127.0.0.1:8000/admin/default/edit/edirelaties/controllers/default.py>,
>>>>>  line 200, in add_protocol
>>>>>     Field('relatie_id', writable=False, readable=False),
>>>>> TypeError: __init__() takes exactly 1 argument (4 given)
>>>>>
>>>>> Where should I look?
>>>>>
>>>>>
>>>>> Op woensdag 7 november 2012 11:54:24 UTC+1 schreef Niphlod het 
>>>>> volgende:
>>>>>>
>>>>>> something else is wrong in your app, that piece of code works 
>>>>>> perfectly fine (the fact that you're declaring 5 fields to let display 
>>>>>> only 
>>>>>> one is quite not understandable but hey, it works nonetheless)
>>>>>>
>>>>>> On Wednesday, November 7, 2012 11:32:39 AM UTC+1, Wouter Pronk wrote:
>>>>>>>
>>>>>>> I have the following code:
>>>>>>> form = SQLFORM.factory(
>>>>>>>             Field('relatie_id', writable=False, readable=False),
>>>>>>>             Field('relatie_nummer', writable=False, readable=False),
>>>>>>>             Field('direction', writable=False, readable=False),
>>>>>>>             Field('protocol', writable=False, readable=False),
>>>>>>>             Field('email', requires=[IS_EMAIL(),IS_NOT_IN_DB(db, 
>>>>>>> 'comprotocol.email')]))
>>>>>>>
>>>>>>> and this is working perfectly in version 1.99 but not in 2.2.1. I 
>>>>>>> get an error:
>>>>>>>
>>>>>>>  File 
>>>>>>> "/home/wouter/Web2py/web2py/applications/edirelaties/controllers/default.py"
>>>>>>>  
>>>>>>> <http://127.0.0.1:8000/admin/default/edit/edirelaties/controllers/default.py>,
>>>>>>>  line 199, in add_protocol
>>>>>>>     Field('relatieid', writable=False, readable=False),
>>>>>>> TypeError: __init__() takes exactly 1 argument (4 given
>>>>>>>
>>>>>>> What is wrong?
>>>>>>>
>>>>>>

-- 



Reply via email to