[web2py] Re: Procedurally add images?

2012-01-02 Thread Massimo Di Pierro
Given db.define_table('image',Field('file','upload')) You can do: import glob for filename in glob.glob('*.png'): db.image.insert(file=db.image.file.store(open(filename,'rb'))) On Jan 2, 10:55 am, vapirix wrote: > I know I can step through my database and add url paths to all of my > da

[web2py] Re: Procedurally add images?

2012-01-02 Thread vapirix
Beautiful. Thanks, Massimo. Once again proving why this is the best framework to get things accomplished with. =) On Jan 2, 11:25 am, Massimo Di Pierro wrote: > Given > > db.define_table('image',Field('file','upload')) > > You can do: > > import glob > for filename in glob.glob('*.png'): >     db