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> |
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
# -*- 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
# -*- 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
table = [(593, 586, 487, '800400'), (594, 593, 487, '800800'), (595, 594, 487, '060000'), (596, 593, 487, '800800'), (592, 591, 487, '060000'), (578, 575, 487, '800800'), (581, 580, 487, '800800'), (570, 488, 487, '010100'), (627, 487, 487, '040000'), (571, 570, 487, '050000'), (572, 570, 487, '050000'), (573, 570, 487, '050000'), (574, 570, 487, '050000'), (575, 570, 487, '800400'), (576, 575, 487, '800800'), (580, 570, 487, '800400'), (579, 578, 487, '060000'), (591, 588, 487, '800800'), (582, 581, 487, '060000'), (583, 580, 487, '800800'), (584, 583, 487, '060000'), (585, 487, 487, '110101'), (586, 585, 487, '010100'), (587, 586, 487, '050000'), (588, 586, 487, '800400'), (589, 588, 487, '800800'), (590, 589, 487, '060000'), (577, 576, 487, '060000'), (569, 565, 487, '050000'), (617, 615, 487, '050000'), (618, 615, 487, '050000'), (619, 487, 487, '040000'), (620, 487, 487, '040000'), (621, 620, 487, '800500'), (622, 621, 487, '800800'), (625, 624, 487, '060000'), (624, 621, 487, '800800'), (614, 611, 487, |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |
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 django.db import migrations, transaction | |
def forwards_func(apps, schema_editor): | |
if settings.DEBUG: | |
# Only in DEBUG mode! | |
try: | |
Account = apps.get_model("accounts", "Account") | |
UserStatus = apps.get_model("accounts", "UserStatus") |
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.contrib.auth.models import AbstractUser, UserManager | |
from django.db import models | |
from django.utils.translation import gettext_lazy as _ | |
class UserStatus(models.IntegerChoices): | |
MODERATOR = 0, _("Модератор") | |
JOBSEEKER = 1, _("Соискатель") | |
EMPLOYER = 2, _("Работодатель") |
OlderNewer