Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Vavilov vapask

  • Saint Petersburg, Russia
View GitHub Profile
View konti.md

ТЗ Блог

  1. Блог представляет из две сущности:
    1. Категории записей
      • Название *
      • Опубликовано
      • поле для ЧПУ *
      • поля для мета-тегов (title, description, keywords)
  • Описание
View keybase.md

Keybase proof

I hereby claim:

  • I am vapask on github.
  • I am vapask (https://keybase.io/vapask) on keybase.
  • I have a public key whose fingerprint is F557 CF57 5B78 1988 30E1 698E 35E2 0016 5342 35E8

To claim this, I am signing this object:

@vapask
vapask / fields.py
Created Apr 7, 2014
Image Free Crop Field for image cropping
View fields.py
from image_cropping.fields import ImageRatioField
class ImageFreeCropField(ImageRatioField):
def __init__(self, *args, **kwargs):
self.keep_ratio = kwargs.pop("keep_ratio", False)
super(ImageFreeCropField, self).__init__(*args, **kwargs)
def formfield(self, *args, **kwargs):
kwargs['widget'] = forms.TextInput(attrs={
'data-width': int(self.width),