書名: Django 2 by Example作者名: Antonio Melé本章字?jǐn)?shù): 37字更新時(shí)間: 2021-06-25 21:19:01
Using exclude()
You can exclude certain results from your QuerySet using the exclude() method of the manager. For example, we can retrieve all posts published in 2017 whose titles don't start with Why:
Post.objects.filter(publish__year=2017) \
.exclude(title__startswith='Why')
推薦閱讀
- 異構(gòu)基因共表達(dá)網(wǎng)絡(luò)的分析方法
- OpenLayers Cookbook
- SD-WAN架構(gòu)與技術(shù)(第2版)
- Drush User’s Guide
- 網(wǎng)絡(luò)的琴弦:玩轉(zhuǎn)IP看監(jiān)控
- 雷達(dá)饋線技術(shù)
- 物聯(lián)網(wǎng)之霧:基于霧計(jì)算的智能硬件快速反應(yīng)與安全控制
- CCNP TSHOOT(642-832)認(rèn)證考試指南
- Learning Windows 8 Game Development
- 網(wǎng)絡(luò)AI+:2030后的未來網(wǎng)絡(luò)
- 沖擊:5G如何改變世界
- 5G技術(shù)核心與增強(qiáng):從R15到R17
- 網(wǎng)絡(luò)空間全球治理觀察
- 計(jì)算機(jī)網(wǎng)絡(luò)技術(shù)
- Intelligent Mobile Projects with TensorFlow