On Apr 11, 3:03 am, jmverm...@xs4all.nl wrote: > And does exactly what I want it to do under all circumstances. Two > more questions though: > > When I remove clubs=[] an error ticket is issued telling me that clubs > is being used before being assigned a value. I haven't seen this:
You are returning a dict with clubs in it so you have to define clubs somewhere, I would set clubs=[] before the if form.accepts . > Furthermore, when I remove requires=IS_NOT_EMPTY() the functionality > breaks, so I need both IS_NOT_EMPTY and requires.self.requires, why? Yes, you need both. The first one defines a restriction for the field in the simulated database. The other one defines a restriction for the custom field in the form. The key word here is custom. If you don't use a widget then form_factory will create the form field with the appropriate requires, but since you need a custom autocomplete field you have to do all the work that SQLFORM does for you (form_factory calls SQLFORM), hence the need for requires=self.requires . > > 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 -~----------~----~----~----~------~----~------~--~---