Setting writable to False is probably the best way to keep that field out 
of the form -- that's why I suggested setting the default value of the 
field instead. Does that not work?

Anthony

On Saturday, December 29, 2012 8:04:05 PM UTC-5, Joe Barnhart wrote:
>
> I was trying to keep the filename out of the generated form since I want 
> it set "automatically" in the process of uploading the document.  Is there 
> a better way to accomplish that?
>
> BTW, the test "if request.vars.upload" does not work.  It returns "False" 
> even if the upload field has been set.  I had to use the much uglier:
>
> if request.vars.upload!=None and request.vars.upload!='':
>
> -- Joe
>
> On Friday, December 28, 2012 3:48:26 PM UTC-8, Anthony wrote:
>>
>> I see. I think the problem is that you have set the writable attribute of 
>> the filename field to False. In that case, try setting the default value of 
>> that field:
>>
>> if request.vars.upload:
>>     db.fileobject.filename.default = request.vars.upload.filename
>> form = SQLFORM(db.fileobject)
>>
>> Anthony
>>
>>>
>>>>>

-- 



Reply via email to