very odd, can you try:: db.companyactivity.activity.requires=[IS_IN_DB(db,db.activity.id,'% (activity_name)s'),IS_NOT_IN_DB(db (db.companyactivity.company==request.vars.company),db.companyactivity.activity)] db.companyactivity.activity.widget=OptionsWidget.widget
Massimo On Jul 10, 1:57 am, annet <annet.verm...@gmail.com> wrote: > Massimo, > > Thanks for putting so much effort in solving this problem. I tried the > latest trunk and replaced my code with the code you provided, the > error ticket I get reads like: > > Traceback (most recent call last): > File "/Library/Python/2.5/site-packages/web2py/gluon/restricted.py", > line 176, in restricted > exec ccode in environment > File "/Library/Python/2.5/site-packages/web2py/applications/cms/ > controllers/appadmin.py", line 255, in <module> > File "/Library/Python/2.5/site-packages/web2py/gluon/globals.py", > line 103, in <lambda> > self._caller = lambda f: f() > File "/Library/Python/2.5/site-packages/web2py/applications/cms/ > controllers/appadmin.py", line 103, in insert > form = SQLFORM(db[table], ignore_rw=ignore_rw) > File "/Library/Python/2.5/site-packages/web2py/gluon/sqlhtml.py", > line 583, in __init__ > elif field.type == 'upload': > File "/Library/Python/2.5/site-packages/web2py/applications/cms/ > models/db.py", line 278, in <lambda> > db.companyactivity.activity.widget=lambda f,v: OptionsWidget.widget > (db.companyactivity.activity,v) > File "/Library/Python/2.5/site-packages/web2py/gluon/sqlhtml.py", > line 195, in widget > options = requires0.other.options() > SyntaxError: widget cannot determine options of > companyactivity.activity > > Since the key value pairs should come from the activity table I gave > that a try: > > db.companyactivity.activity.widget=lambda f,v: OptionsWidget.widget > (db.activity.activity,v) > > .. but that results in the same error. > > I hope you're close to solving this problem. > > 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 -~----------~----~----~----~------~----~------~--~---