On Monday, January 9, 2017 at 12:14:02 PM UTC-5, Terrence Brannon wrote:
>
>
> On Mon, Jan 9, 2017 at 10:55 AM, Anthony wrote:
>
>> Does response.menu have any pre-existing values, 
>>
> Yes it does. Here is a link to the full source code of models/menu.py
> https://github.com/metaperl/trustnet/blob/master/models/menu.py
>  
>
>> and does this happen with the public or logged in menu?
>>
> Public for now as I have not done the same thing with logged-in menu.
>  
>
>> Maybe try inspecting the menu using a web2py shell 
>>
> I did find some discussion of the web2py shell in the book:
>
> http://web2py.com/books/default/chapter/29/02/the-python-language#Starting-up
>
> but not enough to understand how to mimic a request and examine the value 
> of response.menu
>

If you start a shell via:

python web2py.py -S yourapp -M

you'll get a Python shell with a web2py environment, including any objects 
created in your model files. response.menu will therefore be defined as it 
is in your model file (there will be no auth.user in the shell, so nothing 
that requires login will work).
 

>  
>
>> or print the menu to see what it contains.
>>
>
> Where would this print output go? Where would I put such a print 
> statement? The program throws an exception and creates a ticket before a 
> full request is serviced...
>

If you run the built-in web2py server from the command line, any print 
statements will print in that window. You can also set up logging and log 
to a file.
 

>
> If you want to see the full ticket, just visit this URL:
> http://web2py.metaperl.org/refbank
>

Note, external users cannot access your error tickets -- they require 
access to admin via HTTPS and the admin password.

Anthony

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