djangosnippets.org: Latest snippets posted by pmclanahanhttps://djangosnippets.org/users/pmclanahan/2010-01-26T20:01:50.128149-06:00pmclanahanModel Choices Helper
2010-01-26T20:01:50.128149-06:00pmclanahanhttps://djangosnippets.org/snippets/1891/<p>This is my attempt at a convenience class for Django model choices which will use a [Small]IntegerField for storage. It's very similar to <a href="http://www.djangosnippets.org/snippets/1664/">jacobian's version</a>, but I wanted to be able to use simple attributes for access to the integer values.</p>
<p>It's not technically dependent on Django, but it's …</p>
Freely redistributableInclude entire networks in INTERNAL_IPS setting
2009-03-10T12:13:50.250358-05:00pmclanahanhttps://djangosnippets.org/snippets/1362/<p>A simple addition to the settings.py file of your project to allow you to easily specify entire network ranges as internal. This is especially useful in conjunction with other tools such as the <a href="http://github.com/robhudson/django-debug-toolbar/tree/master">Django Debug Toolbar</a>.</p>
<p>After you set this up, the following test should pass</p>
<pre><code>test_str = """ …</code></pre>
Freely redistributable