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
<div class="form">
<div class="row g-2 mt-3">
<h3><span class="font-semi-bold">Consultar cadastro do
paciente</span></h3>
</div>
<form class="form-inline my-2 my-lg-0" action="
http://localhost:6543/queryx" method="GET">
<label for="cpf">Digite o CPF (11 números)</label>
<input class="form-control mr-sm-2" type="text" id="cpf"
name="cpf" required maxlength="11" value=''>
<button class="btn btn-outline-success my-2 my-sm-0"
type="submit">Consultar</button>
</form>
</div>
The result is going to...
action="http://localhost:6543/queryx
How do I take this result to the same page as the query
(templates/pac_recepx.jinja2), that is, place it below the query?
Thank you in advance for your support.
Oberdan Costa
Em quinta-feira, 23 de novembro de 2023 às 16:19:16 UTC-3, Laurent Daverio
escreveu:
> 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:
>
>
> https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#migration-orm-usage
>
> It's a bit more verbose, but closer to SQL :)
>
> Laurent.
>
> Le jeu. 23 nov. 2023 à 20:08, Mike Orr <[email protected]> a écrit :
>
>> On Thu, Nov 23, 2023 at 7:03 AM Oberdan Santos <[email protected]>
>> 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 =
>> request.dbsession.query(Paciente).filter(Paciente.cpf==cpf).all()
>>
>> I remembered that after I wrote the comment, that it's
>> `filtey(Paciente.cpf==cpf)` and `filter_by(cpf=cpf)`. And `filter_by'
>> may not be supported in SQLAlchemy 2.0? I'm still on 1.4/1.3.
>>
>> I'm afraid I don't know enough Portuguese to understand the rest of the
>> message.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pylons-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pylons-discuss/CAH9f%3DupAGsreB_H48SxC0_5fRctbdKSxs7kn1dcOrfZRaycJbw%40mail.gmail.com
>> .
>>
>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/b800223f-dcb3-4a1a-9cd3-ef8c74255b6dn%40googlegroups.com.