I will try this, i already have a python script that parsers a file and
converts to dsv to then add to db, this is the script i am trying to run,
once a upload a file.
On Saturday, July 12, 2014 3:40:10 AM UTC-4, Massimo Di Pierro wrote:
>
> for example, let's say you want to upload text files.
>
>
> db.define_table('one',Field('filename','upload'),Field('processed','boolean',default=False,writable=False))
> db.define_table('two',Field('one','reference one'),Field('results','text'))
>
> def index():
> return dict(form = SQLFORM.grid(db.one))
>
> def process():
> rows = db(db.one.processed=False).select()
> for row in rows:
> (filename, stream) = db.one.filename.retrieve(row.filename)
> ### magic
> db.two.insert(one = row.id, results = stream.read())
> row.update_record(processed = True)
> return '%s records processed' % len(rows)
>
>
>
>
>
>
--
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 the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.