擅长:python、mysql、java
<p>这是合乎逻辑的。如果查询<em>相关的</em>对象,那么Django的过滤机制是存在的:因此,如果一个^{{cd1>}具有此内容,就足够了。</p>
<p>但是,如果对关系执行多个过滤器,这些都会对<em>相同的</em>相关对象产生影响。对于给定的^{cd2>},可能有两个^{cd3>},一个具有^{{cd4>},另一个具有^{cd5>},但如果使用这两个查询,则不会生成元素,因为两个^{{cd3>}是不同的。</p>
<p>例如:</p>
<pre><code>+ -+ + -+ + -+
| RelatedJura | -> | File1 | <- | RelatedJira |
+ -+ + -+ + -+
| content: 5368 | | content: 1112 |
+ -+ + -+
</code></pre>
<p>您的第一个查询读取:</p>
<blockquote>
<p>Give me the <code>File</code>s for which there is a related jira where the content contains <code>1112</code>.</p>
</blockquote>
<p>这是成功的。</p>
<p>第二个查询的内容如下:</p>
<blockquote>
<p>Give me the <code>File</code>s for which there is a related jira where the content contains <code>5368</code>.</p>
</blockquote>
<p>这是成功的。</p>
<p>但最后一个查询是:</p>
<blockquote>
<p>Give me the <code>File</code>s for which there is a related jira where the content contains <code>1112</code> and <code>5368</code>.</p>
</blockquote>
<p>这是失败的,因为没有包含<em>两个</em>子字符串的^{cd3>}。</p>