Hi Nik,

I solved a similar problem like this:

The relevant bits in the old table:

db.define_table('logofile',
    Field('filename',writable=False,readable=False),
 
Field('file',type='upload',default='',notnull=True,autodelete=True),
    migrate='logofile.table')


The function:

def copy_logofiles():
    rows=db().select(db.logofile.ALL,orderby=db.logofile.bedrijf_id)
    for row in rows:
        try:
 
db.new_logofile.insert(filename=row.filename,file=row.file)
        except Exception, e:
            print e
    return 0


In both tables, logofile and new_logofile the logofiles in the uploads
folder are available.


I hope this helps you solve the problem.


Kind regards,

Annet.

Reply via email to