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_Lead.ALL)
else:
* models = 'SELECT Model'*
Error:
<type 'exceptions.AttributeError'>('str' object has no attribute 'Name')
On Monday, February 2, 2015 at 3:38:11 PM UTC-6, Niphlod wrote:
>
> building it by hand kinda slows things down a lot (boilerplate alert!!!!).
> Thankfully, we all know HTML, but.... booooring!!!!!
>
> 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 no "added validation" (both serverside or
> javascript), you can only do
>
> <select><option selected disabled>choose one</option><option value="1"
> ></option>....</select>
>
> i.e. make the first option selected AND disabled. It will show up but the
> user won't be able to transmit it as part of the form, not even in
> javascript (val() of this select would be *null*)
>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.