This is a mistake in the book. Thanks for reporting it.

On Friday, 24 August 2012 08:00:21 UTC-5, Cliff Kachinske wrote:
>
> The book says use code like this:
>
> if request.vars.image!=None:
>     form.vars.image_filename = request.vars.image.filename
>
> The code uses SQLFORM without defining download.  When editing the record, 
> if the upload field has nothing in it, it is empty, not None.  So this 
> exception gets raised:
>
> request.vars.specification.filename
> AttributeError: 'str' object has no attribute 'filename'
>
> This code works.
>
> If request.vars.image: 
>     form.vars.specification_filename = request.vars.specification.filename
>
>
> I can post model and controller if necessary.
>
>

-- 



Reply via email to