On Thursday, November 2, 2017 at 12:52:40 PM UTC-7, Anthony wrote:
>
>
> If I put that print statement in my view, the result is None.
>>>>>>
>>>>>
>>> Note that putting a print statement in a view will have no effect.
>>>
>>
>> It makes the console a little more cluttered.
>>
>
> Right, it will print to the console -- I just meant it won't add anything 
> to the HTML response.
>

Just a debugging tool.
 

>  
>
>> Okay, I was confused.  One belongs to the content, the other to the 
>> transfer, right?
>>
>
> I'm not quite sure what you mean, but <meta> is an HTML tag and therefore 
> ends up in the response body, whereas response.headers are HTTP headers 
> returned with the response.
>  
>
>>    And "inspect-element"'s network tab does show the x-powered by and the 
>> ersatz-meta header.
>>
>> My goal is to compute a refresh rate based on how frequently the table 
>> gets updated (a matter of minutes in my case of interest).  What's the best 
>> way to pass that to the browser?
>>
>
> Is this an Ajax request or full page load? If the latter, you certainly 
> can use the <meta> tag. You can also do automatic page refreshes via 
> Javascript.
>
> Anthony
>


Full page load.  I'm not doing a single-page-app or anything like that.

I was able to add this to layout.html (after line 33 in my 2.14.6 copy) and 
get expected results:

  {{ if "lsrefresh" in globals():}}
  <meta http-equiv="refresh" content={{=lsrefresh}} />
  {{else:}}<!-- NO REFRESH -->
  {{pass}}

I tried using CAT to wrap the strings, but that made a lot of headers 
disappear, probably because of escaping issues.  Now I just have to get my 
controller function to calculate lsrefresh intelligently.

Thanks for the patient help.

/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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to