From 46b9c36ccdd1ee160f83d51d423126b50fa09d85 Mon Sep 17 00:00:00 2001 From: Slava Kyrachevsky Date: Mon, 20 Feb 2017 11:49:46 +0200 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=BE=D1=88=D0=B8?= =?UTF-8?q?=D0=B1=D0=BA=D0=B8=20=D1=81=20=D1=80=D0=B5=D1=81=D0=B0=D0=B9?= =?UTF-8?q?=D0=B7=D0=BE=D0=BC=20=D0=BA=D0=B0=D1=80=D1=82=D0=B8=D0=BD=D0=BE?= =?UTF-8?q?=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/import_xls/utils.py | 17 +++++------------ proj/settings.py | 2 ++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/apps/import_xls/utils.py b/apps/import_xls/utils.py index 3931adad..da4f0289 100644 --- a/apps/import_xls/utils.py +++ b/apps/import_xls/utils.py @@ -134,19 +134,12 @@ def to_periodic(value): def to_audience(obj, value): - # new_list = [] - # if value: - # translation.activate('ru') - # l = value.split(', ') - # target_audience = TargetAudience.objects.all() - # print l - # for value in l: - # for ta in target_audience: - # if value == ta.title: - # new_list.append(ta.pk) - # return new_list translation.activate('ru') - target_audience = TargetAudience.objects.filter(title__in=value.split(', ')).values_list('pk', flat=True) + target_audience = TargetAudience.objects.filter( + title__in=value.split(', ') + ).values_list( + 'pk', flat=True + ) obj.audience.clear() obj.audience.add(*TargetAudience.objects.filter(id__in=target_audience)) return None diff --git a/proj/settings.py b/proj/settings.py index 7efc760a..500f6cb6 100644 --- a/proj/settings.py +++ b/proj/settings.py @@ -507,3 +507,5 @@ try: from proj.local import * except ImportError, e: pass + +THUMBNAIL_DEBUG = DEBUG