Hi folks,

I've recently created some fixture files to prepopulate my
application's database with some data I need to be there from the
beginning. The fixtures are basically files located under the 'models'
directory that contain insert statements (and checks to only execute
the inserts if the table is empty). Like this:

if db(db.professores.id > 0).count() == 0:
    db.professores.insert(id=1, email='fla...@inf.ufrgs.br',
short_name='Flávio', full_name='Flávio Rech Wagner', site='http://
www.inf.ufrgs.br/~flavio')
    db.professores.insert(id=2, email='l...@inf.ufrgs.br',
short_name='Lamb', full_name='Luís da Cunha Lamb', site='http://
www.inf.ufrgs.br/~lamb')
    db.professores.insert(id=3, email='heu...@inf.ufrgs.br',
short_name='Heuser', full_name='Carlos Alberto Heuser', site='http://
www.inf.ufrgs.br/~heuser')

The problem is: I need to have a upload field called 'picture' that,
oh well, keeps a picture. And I need to prepopulate this field in the
fixture, just like the other fields. But my application is GAE-
deployed, and I haven't found a way to do this in a sane way. Do
someone have an idea on how to do that elegantly?

Any help will be greatly appreciated.

Thanks in advance!

Best regards,

Tiago Rosa

Reply via email to