This your actions

def evaluation_data():
    title = 'Evaluation data'

    form = SQLFORM.factory(
        Field('sp', label='Service Provider',
              requires = IS_IN_DB(db,db.service_provider.id, '%
(name)s')),
        Field('form_id', requires =
IS_IN_DB(db,db.evaluation_form.form_id)),
        Field('title',label='Title of workshop/training',
              requires =
IS_IN_DB(db,db.evaluation_form.title_of_training)),
        Field('date','date',requires = IS_DATE(format=T('%Y-%m-%d'),
                                               error_message=T('must
be YYYY-MM-DD!'))))
    if form.accepts(request.vars, session):
        redirect(URL(r=request,
f='search_filled_in_forms',vars=request.vars))
    elif form.errors:
        response.flash = 'form has errors'
    else:
        pass
    return dict(form=form,title=title)

IT DOES NOT DEFINE rows

this your view

evaluation_data.csv:
{{
import cStringIO
stream=cStringIO.StringIO()
rows.export_to_csv_file(stream)
response.headers['Content-Type']='application/vnd.ms-excel'
response.write(stream.getvalue(), escape=False)
}}

IT EXPECTS A VARIABLE rows



On 12 Lug, 14:49, Johann Spies <[email protected]> wrote:
> On 12 July 2010 21:36, mdipierro <[email protected]> wrote:
>
> >  ...evaluation_data.csv... calls evaluation_data action does not
> > define "rows" but the view evaluation_data.csv contains:
>
> > rows.export_to_csv_file(stream)
>
> So why does it complain the name 'row'  does was not defined?
>
> I am sorry but I do not understand now.  I am really desperate and do
> not know what to do now.
> I have a project to finish and this thing is a major obstacle at the
> moment?  I have do deliver this in the next 24 hours.
>
> Can you tell met how to get what I have on the screen as output table
> to a csv-download please?
>
> Regards
> Johann
> --
> "Finally, brethren, whatsoever things are true,  whatsoever things are
> honest, whatsoever things are  just, whatsoever things are pure,
> whatsoever things are lovely, whatsoever things are of good report; if
> there be any virtue, and if there be any praise, think on these
> things."    Philippians 4:8

Reply via email to