Hi Everyone!

I am trying to upload a file using snippets of code I have seen in
other posts and in the manual using GAE locally. It simply does not
create an entry in the document table. Could somebody please look at
my code and tell me where I am going wrong.

Many thanks,
Jason.

manage.py:


@auth.requires_login()
def upload():
    form = SQLFORM(db.document)

    if form.accepts(request.vars, session, dbio = False):
        response.flash = BEAUTIFY(request)
    elif form.errors:
        response.flash = BEAUTIFY(form.errors)

    return dict(form = form)


db.py:


db.define_table('document',
        Field('doc_name'),
        Field('pdf', 'upload', uploadfield = 'pdf_data'),
        Field('pdf_data', 'blob', writable = False, readable = False, default
= ''),
)

Reply via email to