db.child.parent.requires=IS_IN_DB(db, db.parent.id, db.parent._format, zero=T('choose one'))
the dropdown is ok but after that if on some other controler/function I set db.child.parent.writable=False the field only shows the ID, not the name (well the format...)
<!-- central column --------------------------------------------------------…<!-- central column --------------------------------------------------------…{{extend 'plugin_layout_name/layout.html'}}
{{include}}
<td class="row_buttons" nowrap="nowrap">
<a class="button btn btn-default" href="/infocenter/user/index/edit/auth_user/3059?_signature=4fd3e76ccc3017c25f56e3ee3db00f834b683818">
<span class="icon pen icon-pencil glyphicon glyphicon-arrow-pencil"></span>
<span class="buttontext button" title="Edit">Edit</span>
</a>
<a id="230f96c0-8490-4147-a415-d268f9c7698a" class="button btn btn-default" href="/infocenter/user/index/delete/auth_user/3059?_signature=453319f27fb9445e1b0f76dcde5bdb1012b56b7f" data-w2p_remove="tr" data-w2p_method="POST" data-w2p_disable_with="default" data-w2p_confirm="default">
<span class="icon trash icon-trash glyphicon glyphicon-trash"></span>
<span class="buttontext button" title="Delete">Delete</span>
</a>
</td>--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/HWZ_4gyUSPo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
I think the relevant BS3 functionality is there. The only thing we don't have is a BS3 based scaffolding app, but if you're using a custom theme, the scaffolding app probably wouldn't help much anyway (and if you were just going to stick with a relatively unmodified scaffolding app, then it wouldn't much matter whether it were BS2 or BS3, as they would look the same).
Anthony
def my_formstyle(form, fields):
col_sm_label_size = 4
col_md_label_size = 3
form.add_class('form-horizontal col-sm-9 col-md-7 col-lg-5')
label_col_class = "col-sm-%d col-md-%d" % (col_sm_label_size, col_md_label_size)
col_class = "col-sm-%d col-md-%d" % ((12 - col_sm_label_size), (12 - col_md_label_size))
offset_class = "col-sm-offset-%d col-md-offset-%s" % (col_sm_label_size, col_md_label_size)
parent = CAT()
for id, label, controls, help in fields:
# wrappers
_help = SPAN(help, _class='help-block')
# embed _help into _controls
_controls = DIV(controls, _help, _class=col_class)
if isinstance(controls, INPUT):
if controls['_type'] == 'submit':
controls.add_class('btn btn-primary')
_controls = DIV(controls, _class="%s %s" % (col_class, offset_class))
if controls['_type'] == 'button':
controls.add_class('btn btn-default')
elif controls['_type'] == 'file':
controls.add_class('input-file')
elif controls['_type'] == 'text':
controls.add_class('form-control')
elif controls['_type'] == 'email':
controls.add_class('form-control')
elif controls['_type'] == 'password':
controls.add_class('form-control')
elif controls['_type'] == 'checkbox':
label['_for'] = None
label.insert(0, controls)
_controls = DIV(DIV(label, _help, _class="checkbox"),
_class="%s %s" % (offset_class, col_class))
label = ''
elif isinstance(controls, SELECT):
controls.add_class('form-control')
elif isinstance(controls, TEXTAREA):
controls.add_class('form-control')
elif isinstance(controls, SPAN):
_controls = P(controls.components, _class="form-control-static %s" % col_class)
if isinstance(label, LABEL):
label['_class'] = 'control-label %s' % label_col_class
parent.append(DIV(label, _controls, _class='form-group', _id=id))
return parent
grid_ui = dict(widget='',
header='',
content='',
default='',
cornerall='',
cornertop='',
cornerbottom='',
button='btn btn-default button',
buttontext='buttontext button',
buttonadd='glyphicon glyphicon-plus space-after',
buttonback='glyphicon glyphicon-arrow-left space-after',
buttonexport='glyphicon glyphicon-download space-after',
buttondelete='glyphicon glyphicon-trash space-after',
buttonedit='glyphicon glyphicon-pencil space-after',
buttontable='glyphicon glyphicon-arrow-right space-after',
buttonview='glyphicon glyphicon-zoom-in space-after')
grid = SQLFORM.grid(query, fields=fields, orderby=orderby,
create=create, details=details,
editable=editable, deletable=deletable,
csv=False, search_widget=defaultSearch,
paginate=15, maxtextlength=45,
formstyle = my_formstyle, ui=grid_ui)
I think the relevant BS3 functionality is there. The only thing we don't have is a BS3 based scaffolding app, but if you're using a custom theme, the scaffolding app probably wouldn't help much anyway.
Anthony
--
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
def bootstrap3(): # Default web2py scaffolding
def rename(icon): return icon.replace('icon','glyphicon')
self.bar = UL(LI(Anr(I(_class=rename('icon '+items[0]['icon'])),
' ' + items[0]['name'],
_href=items[0]['href'])),_class='dropdown-menu')
def bootstrap3(): # Default web2py scaffolding
def rename(icon): return icon+' '+icon.replace('icon','glyphicon')
self.bar = UL(LI(Anr(I(_class=rename('icon '+items[0]['icon'])),
' ' + items[0]['name'],
_href=items[0]['href'])),_class='dropdown-menu')
Attached is my layout.html...
https://github.com/web2py/web2py/archive/master.zipnote, you have to use formstyle. For auth forms this is now set by default in db.py.form = SQLFORM(..., formstyle = SQLFORM.formstyles.bootstrap3)grid = SQLFORM.grid(..., formstyle = SQLFORM.formstyles.bootstrap3)grid = SQLFORM.smartgrid(..., formstyle = SQLFORM.formstyles.bootstrap3)
On Saturday, 9 August 2014 03:41:15 UTC-5, eric cuver wrote:where i can find the web2py version with bootstrap
Le samedi 9 août 2014 09:17:28 UTC+2, Massimo Di Pierro a écrit :also help us test the grid in trunk.