djangosnippets.org: Latest snippets posted by Moggahttps://djangosnippets.org/users/Mogga/2009-04-07T15:11:55.510868-05:00MoggaLetterbox for sorl-thumbnail
2009-04-07T15:11:55.510868-05:00Moggahttps://djangosnippets.org/snippets/1419/<p>This custom processor is meant for use with sorl-thumbnail to add letterboxing functionality.
Add to your THUMBNAIL_PROCESSORS like so:</p>
<p><code>THUMBNAIL_PROCESSORS = (
'sorl.thumbnail.processors.colorspace',
'sorl.thumbnail.processors.autocrop',
'sorl.thumbnail.processors.scale_and_crop',
'sorl.thumbnail.processors.filters',
# custom processors
'utils.processors.ltbx',
)</code></p>
<p>and then use in your templates like so:</p>
<p><code>{% thumbnail model.img_field 200x150 ltbx as thumb %}
<img src="{{ thumb …</code></p>
Freely redistributableCheck Group Membership Filter
2008-07-18T14:48:03.596759-05:00Moggahttps://djangosnippets.org/snippets/895/<p>Derived from <a href="http://www.djangosnippets.org/snippets/847/">847</a> but allows for checks against multiple groups...</p>
Freely redistributableLDAP to Django Synchronization
2008-07-18T12:13:00.834040-05:00Moggahttps://djangosnippets.org/snippets/893/<p>I needed to be able to synchronize my LDAP users and groups to the Django database. This may not be as efficient as some might like but it works like a charm. It returns a list of messages that I pipe into request.user.messages in my template.</p>
Freely redistributable