diff --git a/.travis.yml b/.travis.yml index b878951..53fcf2f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,4 @@ language: python -sudo: false -language: python cache: pip python: - "2.7" @@ -19,6 +17,7 @@ env: - DJANGO="2.1" - DJANGO="2.2" - DJANGO="3.0" + - DJANGO="3.1" install: pip install tox-travis coveralls script: tox diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d23d00e..40cadc7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,35 @@ Changelog ========= +1.3.0 - Django 3.1 and more +--------------------------- + +Apologies for the late release, and thanks to everyone that contributed. + +Bug fixes +~~~~~~~~~ + +- Add support for python 3.9 and django 3.1 +- import FieldDoesNotExist from django.core.exceptions + +Misc +~~~~ + +- Update django-braces +- Update Admin to show model +- Add Turkish translation +- Correct travis.yml deprecated/dupe keywords + +Contributors +~~~~~~~~~~~~ + +- Pavel Savchenko +- predatell +- Özcan YARIMDÜNYA +- Thu Trang Pham +- João Batista + + 1.2.0 - Django 3 and more ------------------------- diff --git a/README.rst b/README.rst index 1200ab2..622b068 100644 --- a/README.rst +++ b/README.rst @@ -26,8 +26,8 @@ For release notes, see `Changelog = 1.9 (Django 1.9 - 3.0 on Python 2/3/PyPy3) -- django-braces >= 1.4, < 1.14.0 +- Django >= 1.9 (Django 1.9 - 3.1 on Python 2/3/PyPy3) +- django-braces >= 1.4, <= 1.14.0 - simplejson >= 3.6.5, < 4 diff --git a/advanced_filters/__init__.py b/advanced_filters/__init__.py index 58d478a..19b4f1d 100644 --- a/advanced_filters/__init__.py +++ b/advanced_filters/__init__.py @@ -1 +1 @@ -__version__ = '1.2.0' +__version__ = '1.3.0' diff --git a/advanced_filters/admin.py b/advanced_filters/admin.py index 5cd7f5e..6789368 100644 --- a/advanced_filters/admin.py +++ b/advanced_filters/admin.py @@ -107,8 +107,9 @@ class AdvancedFilterAdmin(admin.ModelAdmin): form = AdvancedFilterForm extra = 0 - list_display = ('title', 'created_by', ) + list_display = ('title', 'model', 'created_by', ) readonly_fields = ('created_by', 'model', 'created_at', ) + list_filter = ('model', ) def has_add_permission(self, obj=None): return False diff --git a/advanced_filters/forms.py b/advanced_filters/forms.py index 726622b..32eec22 100644 --- a/advanced_filters/forms.py +++ b/advanced_filters/forms.py @@ -10,7 +10,8 @@ from django.conf import settings from django.contrib import admin from django.contrib.admin.utils import get_fields_from_path -from django.db.models import Q, FieldDoesNotExist +from django.core.exceptions import FieldDoesNotExist +from django.db.models import Q from django.db.models.fields import DateField from django.forms.formsets import formset_factory, BaseFormSet from django.utils.functional import cached_property diff --git a/advanced_filters/locale/tr/LC_MESSAGES/django.po b/advanced_filters/locale/tr/LC_MESSAGES/django.po new file mode 100644 index 0000000..87b424b --- /dev/null +++ b/advanced_filters/locale/tr/LC_MESSAGES/django.po @@ -0,0 +1,156 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-08-09 01:42+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Ozcan Yarimdunya ozcanyd@gmail.com\n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: admin.py:19 +msgid "Advanced filters" +msgstr "Gelişmiş filtreler" + +#: admin.py:70 +msgid "Advanced filter added successfully." +msgstr "Gelişmiş filtre başarıyla eklendi." + +#: forms.py:47 +msgid "Equals" +msgstr "Eşittir" + +#: forms.py:48 +msgid "Contains" +msgstr "İçerir" + +#: forms.py:49 +msgid "One of" +msgstr "Herhangi biri" + +#: forms.py:50 +msgid "DateTime Range" +msgstr "TarihSaat Aralığı" + +#: forms.py:51 +msgid "Is NULL" +msgstr "BOŞ Mu" + +#: forms.py:52 +msgid "Is TRUE" +msgstr "Doğru Mu" + +#: forms.py:53 +msgid "Is FALSE" +msgstr "YANLIŞ Mı" + +#: forms.py:54 +msgid "Less Than" +msgstr "Küçüktür" + +#: forms.py:55 +msgid "Greater Than" +msgstr "Büyüktür" + +#: forms.py:56 +msgid "Less Than or Equal To" +msgstr "Küçük veya Eşittir" + +#: forms.py:57 +msgid "Greater Than or Equal To" +msgstr "Büyük veya Eşittir" + +#: forms.py:61 +msgid "Or (mark an or between blocks)" +msgstr "Veya (bloklar arasından bir tane veya işaretleyin)" + +#: forms.py:65 +msgid "Field" +msgstr "Alan" + +#: forms.py:67 +msgid "Operator" +msgstr "Operatör" + +#: forms.py:71 +msgid "Value" +msgstr "Değer" + +#: forms.py:76 +msgid "Negate" +msgstr "Tersi" + +#: models.py:18 templates/admin/advanced_filters.html:14 +msgid "Advanced Filter" +msgstr "Gelişmiş Filtre" + +#: models.py:19 +msgid "Advanced Filters" +msgstr "Gelişmiş Filtreler" + +#: models.py:21 +msgid "Title" +msgstr "Başlık" + +#: models.py:25 +msgid "Created by" +msgstr "Oluşturan" + +#: models.py:28 +msgid "Created at" +msgstr "Oluşturulma tarihi" + +#: models.py:29 +msgid "URL" +msgstr "URL" + +#: models.py:30 +msgid "Users" +msgstr "Kullanıcılar" + +#: models.py:31 +msgid "Groups" +msgstr "Gruplar" + +#: templates/admin/advanced_filters.html:14 +msgid "Edit" +msgstr "Düzenle" + +#: templates/admin/advanced_filters.html:26 +msgid "Create advanced filter" +msgstr "Gelişmiş filtre oluştur" + +#: templates/admin/advanced_filters.html:64 +msgid "Save" +msgstr "Kaydet" + +#: templates/admin/advanced_filters.html:65 +#: templates/admin/advanced_filters/change_form.html:50 +msgid "Save & Filter Now!" +msgstr "Kaydet & Filtrele" + +#: templates/admin/advanced_filters.html:66 +msgid "Cancel" +msgstr "İptal Et" + +#: templates/admin/advanced_filters/change_form.html:14 +msgid "Change advanced filter" +msgstr "Gelişmiş filtreyi değiştir" + +#: templates/admin/common_js_init.html:14 +msgid "Add another filter" +msgstr "Başka bir filtre ekle" + +#: templates/admin/common_js_init.html:15 +msgid "Remove" +msgstr "Kaldır" diff --git a/advanced_filters/tests/test_forms.py b/advanced_filters/tests/test_forms.py index 0a407f7..7cb2e7f 100644 --- a/advanced_filters/tests/test_forms.py +++ b/advanced_filters/tests/test_forms.py @@ -3,7 +3,8 @@ from django.contrib import admin from django.contrib.auth import get_user_model -from django.db.models import Q, FieldDoesNotExist +from django.db.models import Q +from django.core.exceptions import FieldDoesNotExist from django.test import TestCase import django diff --git a/advanced_filters/views.py b/advanced_filters/views.py index 72e41f9..080d0ef 100644 --- a/advanced_filters/views.py +++ b/advanced_filters/views.py @@ -4,7 +4,7 @@ from django.conf import settings from django.contrib.admin.utils import get_fields_from_path from django.db import models -from django.db.models.fields import FieldDoesNotExist +from django.core.exceptions import FieldDoesNotExist from django.utils.encoding import force_str from django.views.generic import View diff --git a/setup.py b/setup.py index 6fa3bf3..096a6a3 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ -from setuptools.command.test import test as TestCommand -from setuptools import setup, find_packages +import io import os import sys -import io from advanced_filters import __version__ +from setuptools import find_packages, setup +from setuptools.command.test import test as TestCommand class Tox(TestCommand): @@ -64,7 +64,7 @@ def get_full_description(): packages=find_packages(exclude=['tests*', 'tests.*', '*.tests']), include_package_data=True, install_requires=[ - 'django-braces>=1.4.0,<1.14.0', + 'django-braces>=1.4.0,<=1.14.0', 'simplejson>=3.6.5,<4', ], extras_require=dict(test=TEST_REQS), @@ -85,6 +85,7 @@ def get_full_description(): 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Framework :: Django', 'Framework :: Django :: 1.9', 'Framework :: Django :: 1.10', @@ -93,6 +94,7 @@ def get_full_description(): 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.1', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], diff --git a/tox.ini b/tox.ini index 13c3216..d6b3487 100644 --- a/tox.ini +++ b/tox.ini @@ -2,10 +2,11 @@ envlist = py27-django{19,110,111} py35-django{19,110,111,20,21,22} - py36-django{111,20,21,22,30} - py37-django{111,20,21,22,30} - py38-django{22,30} - pypy3-django{19,110,111,20,21,22,30} + py36-django{111,20,21,22,30,31} + py37-django{111,20,21,22,30,31} + py38-django{22,30,31} + py39-django{22,30,31} + pypy3-django{19,110,111,20,21,22,30,31} [pycodestyle] max-line-length = 120 @@ -19,8 +20,9 @@ deps = django111: Django>=1.11,<1.12 django20: Django>=2.0,<2.1 django21: Django>=2.1,<2.2 - django22: Django>=2.1,<2.2 - django30: Django>=2.1,<2.2 + django22: Django>=2.2,<3.0 + django30: Django>=3.0,<3.1 + django31: Django>=3.1,<3.2 commands = pip install -e . @@ -45,3 +47,4 @@ DJANGO = 2.1: django21 2.2: django22 3.0: django30 + 3.1: django31