Django Book 翻译
菜单>:
TOC
返回
原文:
To retrieve a *single* object rather than a list (e.g., ``SELECT foo FROM bar LIMIT 1`` ), use a simple index instead of a slice. For example, this returns the first ``Entry`` in the database, after ordering entries alphabetically by headline:
翻译:
要得到 *单个* 对象而不是一个列表时(例如 ``SELECT foo FROM bar LIMIT 1`` ),可以不用切片而是使用下标。例如,这样就会返回数据库中对标题进行字母排序后的第一个 ``Entry`` :
备注:
译者: