kra*_*r65 5 python sql orm limit peewee
有了Peewee,我试图使用限制如下:
one_ticket = Ticket.select().limit(1)
print one_ticket.count()
Run Code Online (Sandbox Code Playgroud)
但这打印出5.有人知道这里有什么问题吗?
尝试peewee在调试模式下运行,这实际上只是设置 pythonlogging模块来处理logging.DEBUG关卡项:
import logging
logging.basicConfig(
format='[%(asctime)-15s] [%(name)s] %(levelname)s]: %(message)s',
level=logging.DEBUG
)
# From here, you can now perform your query, and you should see peewee's debug output using the logging module.
one_ticket = Ticket.select().limit(1)
print one_ticket.count()
Run Code Online (Sandbox Code Playgroud)
理想情况下,您应该看到原始查询。
| 归档时间: |
|
| 查看次数: |
2763 次 |
| 最近记录: |