You can always define

def UploadField(*a,**b): 
     b['uploadfolder'] = request.folder
     return Field(*a,**b)

db.define_table(.... UploadField(...)....)

I often define

def HiddenField(*a,**b): 
     b['readable'] = b['writable'] = False
     return Field(*a,**b)

def ReadonlyField(*a,**b): 
     b['writable'] = False
     return Field(*a,**b)

def IntegerField(*a,**b): 
     b['type'] = 'integer'
     return Field(*a,**b)

etc.


On Thursday, 5 September 2013 19:22:58 UTC-5, Alan Etkin wrote:
>
> We could use current.request.folder but we would have to couple the dal 
>> code to current. that is something we avoided to far.
>>
>
> I don't think it is necessary to use current in dal just for this. I don't 
> mind adding uploadfolder on each Field(...) call, I just was curious why it 
> was needed. Maybe I would mind if I had a project with lots of code using 
> SQLFORM.factory plus upload fields, which I think is a corner case.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to