2014-12-02 62 views

回答

0

对于更简单的查询,可以使用支持缩短语法的新过滤器选项:

reasons = Reason.all().filter(type_id=3) 
for reason in reasons: 
    # do stuff with reason 

对于更高级的查询,您可以使用查询语法:

from orb import Query as Q 
reasons = Reason.select(where=Q('type_id') == 3) 
for reason in reasons: 
    # do stuff with reason 
相关问题