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/CAB7cU6zkW0WfNdsjtUd-iHPsTJy%2BYZsophLZRht1BSNRwjWo%3Dg%40mail.gmail.com.

Reply via email to