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)




On Thursday, 10 July 2014 06:56:40 UTC-5, David Jobes wrote:
>
> I have a db table that holds the files i have uploaded, i need to then be 
> able to process them and add the information into another db table, i have 
> not been able to find anything on it or in any book. suggestions or ideas
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to