How do I get rid design request response session db tables db stats buttons in a sqlform

254 zobrazení
Přeskočit na první nepřečtenou zprávu

jackso...@quantachrome.com

nepřečteno,
30. 6. 2015 3:30:2830.06.15
komu: web...@googlegroups.com
This  what I have. I want to get rid of the row of buttons at the bottom of the form that says 'design request response session db tables db stats'



View

{{extend 'layout.html'}}
<h2>Input form</h2>
{{=form}}
<h2>Submitted variables</h2>
{{=BEAUTIFY(request.vars)}}
<h2>Accepted variables</h2>
{{=BEAUTIFY(form.vars)}}
<h2>Errors in form</h2>
{{=BEAUTIFY(form.errors)}}


Controller

def display_common_params():
    db3.common_parameters.id.readable=False # Since we do not want to expose the id field on the grid

    form = SQLFORM(db3.common_parameters, buttons = [TAG.button('Back',_type="button",
                                                                _onClick = "parent.location='%s' " % URL('display_all_analysis_stations')),
                                                     TAG.button('Save',_type="submit")])

    if form.accepts(request,session):
        response.flash = 'form accepted'
    elif form.errors:
        response.flash = 'form has errors'
    else:
        response.flash = 'please fill the form'

    return dict(form=form)

Anthony

nepřečteno,
30. 6. 2015 14:24:4630.06.15
komu: web...@googlegroups.com, jackso...@quantachrome.com
Those buttons come from {{=response.toolbar()}} in the view. In the welcome app, the toolbar is only included in the generic.html view, and in that case, only for local requests. If you are seeing the toolbar, either you added it yourself to your layout or the specific view in question, or your specific view is not actually getting executed (perhaps it has the wrong name or location) and instead the generic.html view is being executed (which by default will only work for local requests).

Anthony

jackso...@quantachrome.com

nepřečteno,
1. 7. 2015 15:50:5801.07.15
komu: web...@googlegroups.com
Thanks that was it a typo in naming the respective view.


On Tuesday, June 30, 2015 at 3:30:28 AM UTC-4, jackso...@quantachrome.com wrote:
Odpovědět všem
Odpověď autorovi
Přeposlat
0 nových zpráv