Re: [web2py] Re: How to use requires with list:reference

2014-06-14 Thread Mandar Vaze / मंदार वझे
This is brilliant !! Thanks a LOT Anthony What I ended up doing is : if request.args(0) == "edit": db.child.parent.requires = IS_IN_DB(.) In my actual setup - user does not create new record - so "new" is not an issue *for me*. -Mandar On Thu, Jun 12, 2014 at 4:57 PM, Anthony wrote:

Re: [web2py] Re: How to use requires with list:reference

2014-06-12 Thread Anthony
> Are you saying you want the user to enter a last name for the child and >> then have the drop-down dynamically updated with the list of parents with >> the entered last name? If so, obviously that cannot be done at the time the >> form is generated on the server because you don't know what n

Re: [web2py] Re: How to use requires with list:reference

2014-06-11 Thread Mandar Vaze / मंदार वझे
Anthony, Let me say that you have been tremendous help. On Wed, Jun 11, 2014 at 6:00 PM, Anthony wrote: > Are you saying you want the user to enter a last name for the child and > then have the drop-down dynamically updated with the list of parents with > the entered last name? If so, obviously

Re: [web2py] Re: How to use requires with list:reference

2014-06-11 Thread Anthony
Are you saying you want the user to enter a last name for the child and then have the drop-down dynamically updated with the list of parents with the entered last name? If so, obviously that cannot be done at the time the form is generated on the server because you don't know what name the user

Re: [web2py] Re: How to use requires with list:reference

2014-06-11 Thread Mandar Vaze / मंदार वझे
On Tue, Jun 10, 2014 at 11:23 PM, Anthony wrote: > Assuming you have a particular parent last name, it would be: > > IS_IN_DB(db(db.parent.lname == last_name), 'parent.id', db.parent._format, > multiple=True) > > Above would work for a "fixed" last name. But I need it to work with "lambda" - wher

Re: [web2py] Re: How to use requires with list:reference

2014-06-10 Thread Anthony
Assuming you have a particular parent last name, it would be: IS_IN_DB(db(db.parent.lname == last_name), 'parent.id', db.parent._format, multiple=True) Anthony On Tuesday, June 10, 2014 12:51:20 PM UTC-4, Mandar Vaze wrote: > > > On Tue, Jun 10, 2014 at 7:53 PM, Anthony wrote: > >> The first a

Re: [web2py] Re: How to use requires with list:reference

2014-06-10 Thread Mandar Vaze / मंदार वझे
On Tue, Jun 10, 2014 at 7:53 PM, Anthony wrote: > The first argument to IS_IN_DB must be a DAL object or a Set object -- it > cannot be a function. > Right, but is there a way to achieve what I am trying to do ? an example would help. Can/should I use IS_IN_SET ? (I got different error mentioned

[web2py] Re: How to use requires with list:reference

2014-06-10 Thread Anthony
The first argument to IS_IN_DB must be a DAL object or a Set object -- it cannot be a function. Anthony On Tuesday, June 10, 2014 10:05:21 AM UTC-4, Mandar Vaze wrote: > > when using default 'list:reference mytable' all the entries from mytable > are shown in the dropdown (when using SQLFORM.gr