djangosnippets.org: Latest snippets posted by obeattiehttps://djangosnippets.org/users/obeattie/2007-12-16T04:43:01-06:00obeattiePickled Object Field2007-12-16T04:43:01-06:00obeattiehttps://djangosnippets.org/snippets/513/<p><em>Incredibly useful for storing just about anything in the database (provided it is Pickle-able, of course) when there isn't a 'proper' field for the job:</em></p>
<p>A field which can store any pickleable object in the database. It is database-agnostic, and should work with any database backend you can throw ...</p>
Freely redistributableTemplate tag for returning &#39;Morning&#39;, &#39;Afternoon&#39; and &#39;Evening&#39; in the local timezone2007-04-17T01:27:20-05:00obeattiehttps://djangosnippets.org/snippets/185/<p>Returns 'Morning', 'Afternoon', or 'Evening' in the local timezone (specified in settings). Required pytz. 0000-1200 considered morning, 1200-1800 considered afternoon, 1800-0000 considered evening.</p>
Freely redistributableSmartyPants Filter2007-04-17T01:23:15-05:00obeattiehttps://djangosnippets.org/snippets/184/<p>Really simple filter for using Smartpants in your template -- placed in your custom filters file. Requires python smartypants to be installed.</p>
Freely redistributableFunction to create resized versions of an image from a URL and saving it to a local path2007-02-28T15:48:37-06:00obeattiehttps://djangosnippets.org/snippets/53/<p>This is a really useful function I used to create the resized preview images you can see on the <a href="http://www.obeattie.com/">homepage of my site</a>. Basically, it takes the original URL of an image on the internet, creates a resized version of that image by fitting it into the constraints specified (doesn ...</p>
Freely redistributableConverting a Flickr Datetime to a Python Datetime2007-02-27T16:46:14-06:00obeattiehttps://djangosnippets.org/snippets/37/<p>Though this may not be Django (just basic Python) this kind of thing sure does come in handy! <strong>Plus, it's super easy to edit for any datetime format you want to throw at it.</strong></p>
Freely redistributable