I am not sure if I understood correctly your intention.
In your model you can define widgets for your input fields.
When you want to construct a custom SQLFORM you can override it. In SQLFORM
constructor there is a field "formstyle". Just define a function:
def formstyle_custom(form, fields):
div = TAG['']()
div.append(<html helpers you need>)
for id, label, controls, help in fields:
#just an example
div.append(DIV(label, controls))
script = """js stuff and other fireworks you need"""
return TAG[''](div, SCRIPT(script))
I hope it is correct approach. If not, please correct me. I am also a
newbie:)
Regards!
W dniu niedziela, 21 lipca 2013 10:52:10 UTC+2 użytkownik Rollover Cable
napisał:
>
> Hello everybody, can someone give me some light how to accomplish this
> kind of stuff
> i want to build horizontal forms from bootstrap sample (
> http://twitter.github.io/bootstrap/base-css.html#forms) using
> form/sqlform( what is the best practices to login form form/sqlform* ?)
> i read the docs and do googling,
> can anyone give me some example how to to that. the example code is below
> <form class="form-horizontal">
> <div class="control-group">
> <label class="control-label" for="inputEmail">Email</label>
> <div class="controls">
> <input type="text" id="inputEmail" placeholder="Email">
> </div>
> </div>
> <div class="control-group">
> <label class="control-label" for="inputPassword">Password</label>
> <div class="controls">
> <input type="password" id="inputPassword" placeholder="Password">
> </div>
> </div>
> <div class="control-group">
> <div class="controls">
> <label class="checkbox">
> <input type="checkbox"> Remember me
> </label>
> <button type="submit" class="btn">Sign in</button>
> </div>
> </div>
> </form>
> how to build custom login sqlform/sqlfrom.smartgrid/sqlform.factory in
> controller using the code above
> i read the docs but still don't get it
>
> Notes:
> 1. i'm not using all web2py css and js ( i'm using original twitter
> bootstrap, no tweak etc ).
> 2. i'm totally newbie, so i'm using web2py to learn twitter bootstrap ,
> java script + python. so i have different purpose, different path,
> different goal to achieve, that's why i'm not using the default css and js
> script.
> some people might say i should go with flask/bottle if want to build
> something from scratch but i want to stick with web2py.
>
>
> Thanks
>
>
--
---
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.