Skip to content

Instantly share code, notes, and snippets.

@h3
h3 / adminthumbnail.py
Created Apr 16, 2012
AdminThumbnailMixin
View adminthumbnail.py
from django.contrib import admin
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from easy_thumbnails.files import get_thumbnailer
class AdminThumbnailMixin(object):
thumbnail_options = {'size': (60, 60)}
thumbnail_image_field_name = 'image'
thumbnail_alt_field_name = None
@h3
h3 / auth_users.tpl.json
Created Dec 1, 2011
Template fixtures concept
View auth_users.tpl.json
{% load fixture_tags %}
[
{% genfixtures "1:5" %}
{
"pk": {{ fixture.pk }},
"model": "auth.user",
"fields": {
"username": "{% gen_char "my_custom_username_generator" %}",
"first_name": "{% gen_char "first_name" %}",
"last_name": "{% gen_char "last_name" %}",