djangosnippets.org: Latest snippets tagged with 'iexact'https://djangosnippets.org/tags/iexact/2007-07-09T00:10:05.010560-05:00Case-insensitive lookup by default
2007-07-09T00:10:05.010560-05:00sciyoshihttps://djangosnippets.org/snippets/305/<p>I wanted lookups on tags to be case insensitive by default, so that things like</p>
<pre><code>Tag.objects.get(name='Tag')
</code></pre>
<p>would return any similar tags (ignoring case differences), i.e. <code><Tag: tag></code>.</p>
<p>This snippet makes lookup on the 'name' field case-insensitive by default, although
case-sensitive lookups can still be achieved with 'name__exact'. Methods like …</p>
Freely redistributable