This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from collections import OrderedDict, namedtuple | |
from pprint import pprint | |
def group_by_key(iterable, key, sum_field): | |
"""Группирует список по полю key и суммирует по полю sum_field | |
iterable - список именованных кортежей | |
key - строка, название общего поля для группировки |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.utils.html import format_html | |
from django.db import models | |
STATUS_CHOICES = ( | |
('draft', 'Черновик'), | |
('published', 'Опубликовано'), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from PIL import Image, ImageEnhance | |
import os | |
import pdb | |
def get_box_thumb(image, TIS): | |
""" | |
image - объект картинка, на которую накладываете изображение | |
TIS - THUMB_IMAGE_SIZE (50, 50) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ru"> | |
<head> | |
<link rel="stylesheet" href="main.css" /> | |
<link rel="icon" type="image/x-icon" href="icon/favicon.ico"> | |
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"> | |
<meta charset="utf-8"> | |
<title>Мебель класс 31</title> | |
</head> | |
<body> |
NewerOlder