Skip to content

Commit

Permalink
Drop support for Django < 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hramezani committed Aug 17, 2022
1 parent 2dab8af commit bd0e5a8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Unreleased
- Confirm support for `Django 4.0`
- Add Spanish translation
- Add French translation
- Drop support for `Django < 3.2`

4.2.0 (2021-10-11)
------------------
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ django-model-utils

Django model mixins and utilities.

``django-model-utils`` supports `Django`_ 2.2+.
``django-model-utils`` supports `Django`_ 3.2+.

.. _Django: http://www.djangoproject.com/

Expand Down
2 changes: 1 addition & 1 deletion docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ modify your ``INSTALLED_APPS`` setting.
Dependencies
============

``django-model-utils`` supports `Django`_ 2.2, 3.1 and 3.2 (latest bugfix
``django-model-utils`` supports `Django`_ 3.2+ (latest bugfix
release in each series only) on Python 3.6+.

.. _Django: http://www.djangoproject.com/
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def long_desc(root_path):
maintainer='JazzBand',
url='https://github.com/jazzband/django-model-utils',
packages=find_packages(exclude=['tests*']),
install_requires=['Django>=2.2'],
install_requires=['Django>=3.2'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
Expand All @@ -44,8 +44,6 @@ def long_desc(root_path):
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
],
Expand Down
10 changes: 3 additions & 7 deletions tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,9 @@ def __get__(self, obj, cls=None):
return self
if self.name in obj.get_deferred_fields():
# This queries the database, and sets the value on the instance.
if django.VERSION < (3, 0):
DeferredAttribute(field_name=self.name).__get__(obj, cls)
else:
# Since Django 3.0, DeferredAttribute wants a field argument.
fields_map = {f.name: f for f in cls._meta.fields}
field = fields_map[self.name]
DeferredAttribute(field=field).__get__(obj, cls)
fields_map = {f.name: f for f in cls._meta.fields}
field = fields_map[self.name]
DeferredAttribute(field=field).__get__(obj, cls)
return str(obj.__dict__[self.name])

def __set__(self, obj, value):
Expand Down
3 changes: 0 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tox]
envlist =
py{36,37,38,39}-dj{22,31}
py{36,37,38,39,310}-dj32
py{38,39,310}-dj{40,main}
flake8
Expand All @@ -18,8 +17,6 @@ python =
deps =
freezegun==0.3.12
-rrequirements-test.txt
dj22: Django==2.2.*
dj31: Django==3.1.*
dj32: Django==3.2.*
dj40: Django==4.0.*
djmain: https://github.com/django/django/archive/main.tar.gz
Expand Down

0 comments on commit bd0e5a8

Please sign in to comment.