Skip to content

Instantly share code, notes, and snippets.

@CBoJI
CBoJI / .py
Created September 2, 2012 08:37
смена цвета картинок при наведении с серого на цветной. используется 1 картинка, css, thumbnail
from sorl.thumbnail import get_thumbnail
partners = []
total_width = 0
for partner in PartnerItem.objects.filter(published=True).order_by('?'):
im = partner.get_first_picture()
tmp = get_thumbnail(im.image, 'x64', crop='center center')
total_width += tmp.width
if total_width > 960:
break
else: