[web2py] Re: Default value (Not in table) in Dropdown

2015-02-02 Thread Niphlod
building it by hand kinda slows things down a lot (boilerplate alert). Thankfully, we all know HTML, but bring! Having a widget displaying a default value (that won't get accepted) is pretty damn easy with IS_IN_SET(..., zero='choose me...') with html and the requirement of

[web2py] Re: Default value (Not in table) in Dropdown

2015-02-02 Thread Omi Chiba
In my controller, can I just add the default value in controller something like below? If possible, this is the easiest one for me. Though I will get error I do this. *controller* if request.vars.model_name: models = db(db.KR_Lead.ModelName == request.vars.model_name).select(db.KR_

[web2py] Re: Default value (Not in table) in Dropdown

2015-02-02 Thread Niphlod
that's pretty obvious. look at what you're trying to render in the view! {{for model in models:}} {{=model.Name}} {{pass}} at the very least, if you want to keep the same code in the view, you should have the controller pass a list with a Storage() that has a "Name" at

[web2py] Re: Default value (Not in table) in Dropdown

2015-02-02 Thread Omi Chiba
Thanks. It worked great!!! On Monday, February 2, 2015 at 4:07:36 PM UTC-6, Niphlod wrote: > > that's pretty obvious. look at what you're trying to render in the > view! > > > {{for model in models:}} > {{=" selected='selected'" if model.Name==request.vars.model_name else > ""}