Horst, As far as I can tell the preceding lines of code are correct. The validator was an IS_IN_DB() validator, which worked. The problem arises when I replace the IS_IN_DB() validator by the auto_complete field. I used the widget before in a form:
form=form_factory(SQLField('plaats',requires=IS_NOT_EMPTY (),widget=lambda self, value:INPUT (_id='byplace',_name='plaats',_class='ac_input',_type='text',requires=self.requires))) Alexey, Correct me if I am wrong, to me this is web2py telling ([ reporting verb ] communicate information, facts, or news to someone in spoken or written words) me that my code is syntactically incorrect: Traceback (most recent call last): File "/Library/Python/2.5/site-packages/web2pyfitwise/gluon/ restricted.py", line 97, in restricted ccode = compile(code.replace('\r\n', '\n'), layer, 'exec') File "/Library/Python/2.5/site-packages/web2pyfitwise/applications/ cms/models/db.py", line 103 db.adres.plaats.requires=[IS_NOT_EMPTY(),widget=lambda self, value:INPUT (_id='place',_name='plaats',_class='ac_input',_type='text')] ^ SyntaxError: invalid syntax ... and this is the Python interpreter telling me the same: annet:~ iannet$ python Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> db.adres.plaats.requires=[IS_NOT_EMPTY(),widget=lambda >>> self,value:INPUT(_id='place',_name='plaats',_class='ac_input',_type='text')] File "<stdin>", line 1 db.adres.plaats.requires=[IS_NOT_EMPTY(),widget=lambda self,value:INPUT (_id='place',_name='plaats',_class='ac_input',_type='text')] ^ SyntaxError: invalid syntax >>> I posted my problem to get it solved not to get it confirmed;-) >what 'smth=' statement does inside a list?? This sentence is too cryptic to me. This works: widget=lambda self, value:INPUT (_id='byplace',_name='plaats',_class='ac_input',_type='text',requires=self.requires) How do I have to adjust and where do I put it in my code to get an auto_complete field in an SQLFORM? Kind regards, Annet. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---