Re: [pylons-discuss] Display query and result on the same page

2023-11-23 Thread Mike Orr
On Thu, Nov 23, 2023 at 11:50 AM Oberdan Santos wrote: > > You should note in the subject statement that in addition to the query, I > have the problem of the result being published on another page. > query page code > # templates/pac_recepx.jinja2 > > > > Consultar

Re: [pylons-discuss] Display query and result on the same page

2023-11-23 Thread Laurent Daverio
Well, to be honest, it's not a question about Pyramid, it's a question about an absolutely basic pattern in web programming. I was doing that with Perl CGI scripts 25 years ago, when Python was still in infancy, and Pyramid didn't exist. The problem is actually very simple : you use *one* view,

Re: [pylons-discuss] Display query and result on the same page

2023-11-23 Thread Oberdan Santos
You should note in the subject statement that in addition to the query, I have the problem of the result being published on another page. query page code # templates/pac_recepx.jinja2 Consultar cadastro do paciente http://localhost:6543/queryx;

Re: [pylons-discuss] Display query and result on the same page

2023-11-23 Thread Laurent Daverio
Hi Mike, .filter() and .filter_by() are still both valid in SQLAlchemy 2.x. I think .filter() is a synonym of .where(). Note : what is deprecated, but still available, is the "query syntax". I even think it's no longer documented. Recommended syntaxes are here:

Re: [pylons-discuss] Display query and result on the same page

2023-11-23 Thread Mike Orr
On Thu, Nov 23, 2023 at 7:03 AM Oberdan Santos wrote: > O codigo no formato acima não executou, apresentou erro, mas foi de grande > valia, muito obrigado). Fiz uma pequena alteração e deu certo. > Funcionou assim: > cpf = request.params["cpf"] >rows =

Re: [pylons-discuss] Display query and result on the same page

2023-11-23 Thread Oberdan Santos
The simplest way is: ``` cpf = request.params["cpf"] rows = request.dbsession.query(Paciente).filter(cpf=cpf),all() ``` O codigo no formato acima não executou, apresentou erro, mas foi de grande valia, muito obrigado). Fiz uma pequena alteração e deu certo. Funcionou assim: cpf =