Thank you! Problem is solved. 
As you said, I think download function code was not executing because of 
caching. I am looking for printed value in terminal and download function 
is in the same controller as the action that displays link.

On Wednesday, June 17, 2015 at 11:07:25 PM UTC+5:30, Anthony wrote:
>
> Is your download function in the same controller as the action that 
> displays the link (if not, you need to specify the controller in the URL() 
> function)? Also, where are you looking for the printed value -- it will 
> appear in the console? Finally, you have the @cache.action() decorator on 
> the download function, so if you have already downloaded the file once, it 
> may have been cached, so the download function code (including the print 
> statement) will not re-execute.
>
> Anthony
>
> On Wednesday, June 17, 2015 at 2:57:42 AM UTC-4, Gaurav Vichare wrote:
>>
>> I want to print request.args inside download controller for testing. But 
>> it dosn't print anything. It print "request" but not request.args.
>>
>> Download controller :
>>
>> @cache.action()
>> def download():
>>     """
>>     allows downloading of uploaded files
>>     http://..../[app]/default/download/[filename]
>>     """
>>
>>     print request.args
>>
>>     return response.download(request, db)
>>
>> View that calls download controller:
>>
>> {{left_sidebar_enabled,right_sidebar_enabled=False,('message' in 
>> globals())}}
>> {{extend 'layout.html'}}
>>
>> <table border="1">
>> <tr>   
>>     <th>Name</th>
>>     <th>Contract File</th>
>>
>> </tr>
>> {{for contract in contracts:}}
>>   <tr>
>>       <td> {{=contract.contract_filename}} </td>
>>       <td><a href="{{=URL('download', 
>> args=contract.contract)}}">Download</a></td>
>>   </tr>
>>  {{pass}} 
>> </table>
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to