python - Is there a way to print out output in a pyramid view callable? -


i new python , pyramid , trying figure out way print out object values using in view callable better idea of how things working. more specifically, wanting see coming out of sqlalchemy query.

dbsession.query(user).filter(user.name.like('%'+request.matchdict['search']+'%')) 

i need take query , office user belongs office_id attribute part of user object. thinking of looping through users come query , doing query office information (in offices table). need build dictionary includes user information , office information return browser json.

is there way can experiment different attempts @ while viewing output without having rely on browser. more of front end developer when writing javascript view outputs using console.log(output).

console.log(output) javascript

as

????? python (specifically pyramid view callable)

hope question not dumb. trying learn. appreciate anyones help.

this reason experiment pshell, pyramid's interactive python interpreter. within pshell can tinker things on command-line , see before adding them application.

http://docs.pylonsproject.org/projects/pyramid/en/1.4-branch/narr/commandline.html#the-interactive-shell

of course, can use "print" , things show in console. sqlalchemy has sqlalchemy.echo ini option can turn on see queries. , finally, sounds need join maybe aren't familiar how write complex database queries, i'd suggest before resorting writing separate queries. single query can return need.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -