Also, in this case it would be '%(city_name)s' rather than '%(name)s'. On Thursday, July 4, 2013 11:31:18 AM UTC-4, Anthony wrote: > > Though there is no reason to define the requires in this case, as you get > that exact validator by default simply by defining it as a reference field > (and specifying the "format" argument of the parent table). > > Anthony > > On Thursday, July 4, 2013 5:50:14 AM UTC-4, Rohitraj Sharma wrote: >> >> sorry bro >> in place of parent there should be table name >> db.children.city.requires = IS_IN_DB(db, >> db.tablename.id<http://db.parent.id/> >> ,'%(name)s') >> >> On Thursday, 4 July 2013 14:02:52 UTC+5:30, Kamil wrote: >>> >>> Thanks, adding format='%('city_name)s' solves the first problem. That's >>> obviously in the book... >>> >>> But the line db.children.city.requires = IS_IN_DB(db, >>> db.parent.id,'%(name)s') >>> doesn't work actually. I get: >>> <type 'exceptions.AttributeError'> 'DAL' object has no attribute 'parent' >>> >>
-- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

