SORU
30 EKİM 2011, Pazar


Kullanarak VEYA SQLAlchemy içinde

through the docs baktım ve ben cant SQLAlchemy VEYA bir sorgu yapmak için nasıl bulmak için görünmüyor. Ben sadece bu sorgu yapmak istiyorum.

SELECT address FROM addressbook WHERE city='boston' AND (lastname='bulger' OR firstname='whitey')

Gibi bir şey olmalı

addr = session.query(AddressBook).filter(City == "boston").filter(????)

CEVAP
30 EKİM 2011, Pazar


tutorial:

from sqlalchemy import or_
filter(or_(User.name == 'ed', User.name == 'wendy'))

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • ghosti66

    ghosti66

    27 AĞUSTOS 2006
  • jesiel santos

    jesiel santo

    15 Ocak 2009
  • SoundHound

    SoundHound

    8 Mart 2006