The issue is do you want 1) a new copy of the default file for every record 
or 2) do you want all default files pointing to the same one?

In case 2) you should be able to do from the shell:

filename = db.docs.filepath.store(open('default.png'))

then use in your action:

db.docs.filepath.default = filename



On Sunday, 25 November 2012 15:52:26 UTC-6, wwwgong wrote:
>
> Hi, 
> I like to build a small web2py app to manage documents on my computer. 
> e.g. 
> db.define_table('docs',
>     Field('filename'),
>     Field('filetype'),
>     Field('category'),
>     Field('description'),
>     Field('filepath','upload')
> );
>
> If I like to create a new document,e.g. 'test.doc', how can web2py 
> pre-default an empty .doc file into "uploads" folder before I would later 
> add content to file in OS.
> In above table, a new record should be created with : 
>
> filename='test', 
>
> filetype='doc', 
>
> category='test', 
>
> description='test', 
>
> filepath='test-xxxxxxxxxxxxxx.doc'
>
>
> Thanks for your help
>
> Wen 
>
>

-- 



Reply via email to