Also, dict() is for creating a dictionary -- there is no reason to do 
dict(redirect(...)). Also, you do not return a redirect() -- you simply 
call it, and it immediately raises an HTTP exception.

Anthony

On Friday, November 6, 2015 at 1:50:15 PM UTC-5, Dave S wrote:
>
>
>
> On Friday, November 6, 2015 at 9:33:47 AM UTC-8, Karl Florian wrote:
>>
>> *Sorry everybody but i need your help again.*
>>
>> Here is my code:
>>
>> def languages_pedit(): 
>>
>
> [...]
>  
>
>>   
>>
>>  * #I tried this mk_pdffile(pdffile,'languages.pdf') but it did not work*
>>
>> def mk_pdffile(pdffile,pdfname):
>>
>>   import cStringIO
>>
>>   pdfdata = open(pdffile,"rb").read()
>>
>>   response.headers['Content-Type']='application/pdf' 
>>
>>   return response.stream(cStringIO.StringIO(pdfdata), attachment=True, 
>> filename=pdfname)
>>
>>
> Where does the "does not work" part stop and the "this works fine part 
> start? 
>
>>  
>>
>> @auth.requires_login()
>>
>> def print_languages(): 
>>
> [...]  .......................................
>>
>>   #Code to make my texfile....................
>>
>>   .......................................
>>
>>   texfile.write('\\end{document}\n')
>>
>> [...] 
>
>>   return response.stream(cStringIO.StringIO(pdfdata), attachment=True, 
>> filename='languages.pdf') 
>>
>>  
>>
>> *This works fine but the code below does not get excecuted and my SUBMIT 
>> Button stays pressed?*
>>
>>   
>>
>>   return dict(redirect(URL('languages_pedit')))
>>
>>
>
> Where does this go?  If right after the "return response.stream()", then 
> it will never get executed.
>  
>
>> def example():
>   return 1
>   return 2
>
>
> will always return 1.
>
> /dps
>  
>

-- 
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