Final solution was this:
_tables.py
def store_file(file, filename=None, path=None):
path = path #"applications/init/uploads"
if not os.path.exists(path):
os.makedirs(path)
pathfilename = os.path.join(path, filename)
dest_file = open(pathfilename, 'wb')
try:
Thank you Leonel, great idea.
Although I'll need to use oncreate/onupdate since I'm using a smartgrid
Cheers,
-James
On Tuesday, December 2, 2014 10:28:49 PM UTC+13, Leonel Câmara wrote:
>
> There are lots of ways to do this, the easiest is probably to just define
> the uploadfolder for the fi
There are lots of ways to do this, the easiest is probably to just define
the uploadfolder for the field in the controller for workbench
creation/update instead of defining your custom store and retrieve.
Something like this:
def create_workbench():
""" Form to create a workbench in a give
Any ideas?
Cheers
On Monday, December 1, 2014 11:46:57 AM UTC+13, Massimo Di Pierro wrote:
>
> You cannot do this uploadfolder= lambda r:...
> But this is a chicken-egg problem. You want r to be the row but the row is
> not created until after the file is uploaded therefore you cannot specify
>
Thank you for your help Massimo.
My model is defined as follows:
## Repository
db.define_table('repository',
Field('name', type='string'),
Field('directory', default='applications/init/uploads'),
format='%(name)s')
## Workbench - workbenches stored in the repository
db.
You cannot do this uploadfolder= lambda r:...
But this is a chicken-egg problem. You want r to be the row but the row is
not created until after the file is uploaded therefore you cannot specify
the upload folder as function of something that happens after.
Please explain to us in english of the
6 matches
Mail list logo