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

254 vues
Accéder directement au premier message non lu

jackso...@quantachrome.com

non lue,
30 juin 2015, 03:30:2830/06/2015
à 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

non lue,
30 juin 2015, 14:24:4630/06/2015
à 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

non lue,
1 juil. 2015, 15:50:5801/07/2015
à 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:
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message