# django-model-utils

> Django model mixins and utilities

- **URL**: https://www.freshcrate.ai/projects/django-model-utils
- **Author**: Carl Meyer
- **Category**: Frameworks
- **Latest version**: `5.0.0` (2026-04-21)
- **License**: BSD
- **Source**: https://github.com/jazzband/django-model-utils
- **Language**: Python
- **GitHub**: 2,759 stars, 371 forks
- **Registry**: pypi (`django-model-utils`)
- **Tags**: `pypi`

## Description

==================
django-model-utils
==================

.. image:: https://jazzband.co/static/img/badge.svg
   :target: https://jazzband.co/
   :alt: Jazzband
.. image:: https://github.com/jazzband/django-model-utils/workflows/Test/badge.svg
   :target: https://github.com/jazzband/django-model-utils/actions
.. image:: https://codecov.io/gh/jazzband/django-model-utils/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/jazzband/django-model-utils
.. image:: https://img.shields.io/pypi/v/django-model-utils.svg
   :target: https://pypi.python.org/pypi/django-model-utils
.. image:: https://img.shields.io/pypi/pyversions/django-model-utils.svg
   :target: https://pypi.python.org/pypi/django-model-utils
   :alt: Supported Python versions
.. image:: https://img.shields.io/pypi/djversions/django-model-utils.svg
   :target: https://pypi.org/project/django-model-utils/
   :alt: Supported Django versions

Django model mixins and utilities.

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

.. _Django: https://www.djangoproject.com/

This app is available on `PyPI`_.

.. _PyPI: https://pypi.python.org/pypi/django-model-utils/

Getting Help
============

Documentation for django-model-utils is available
https://django-model-utils.readthedocs.io/

Contributing
============

Please file bugs and send pull requests to the `GitHub repository`_ and `issue
tracker`_. See `CONTRIBUTING.rst`_ for details.

.. _GitHub repository: https://github.com/jazzband/django-model-utils/
.. _issue tracker: https://github.com/jazzband/django-model-utils/issues
.. _CONTRIBUTING.rst: https://github.com/jazzband/django-model-utils/blob/master/CONTRIBUTING.rst


Changelog
=========

5.0.0 (2024-09-01)
------------------
- Add formal support for `Django 5.1`
- Remove MonitorField deprecation warning. `None` - instead of
  `django.utils.timezone.now` will be used when nullable and no default provided (GH-#599)
- Add deprecation warning for MonitorField. The default value will be `None`
  instead of `django.utils.timezone.now` - when nullable and without a default.
- Add Brazilian Portuguese translation (GH-#578)
- Don't use `post_init` signal for initialize tracker
- Make `contribute_to_class()` in `StatusField`, `MonitorField` and `SplitField`
  forward additional arguments to Django
- `SplitField` no longer accepts `no_excerpt_field` as a keyword argument
- Make `soft` argument to `SoftDeletableModel.delete()` keyword-only
- `JoinManager` and `JoinManagerMixin` have been deprecated;
  please use ``JoinQueryset.as_manager()`` instead
- Change `SoftDeletableQuerySetMixin.delete` to replicate Django's API.

4.5.1 (2024-05-02)
------------------

- Remove `JoinQueryset.get_quoted_query()` by @mthuurne (GH-#618)

4.5.0 (2024-04-01)
------------------

- Don't use `post_init` signal for initialize tracker by @meanmail in -  (GH-#556)
- clarify docs for managers of SoftDeletableModel by @tadamcz in -  (GH-#589)
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in -  (GH-#575)
- `Language Support` - Add translations for Brazilian Portuguese by @gmcrocetti in -  (GH-#578)
- Remove dead `init_deferred_fields` method by @joecox in -  (GH-#580)
- Update where `ConnectionDoesNotExist` is imported from by @mthuurne in -  (GH-#566)
- Remove arguments from `InheritanceQuerySetMixin._clone()` by @mthuurne in -  (GH-#567)
- Allow running tests using sqlite by @jayvdb in -  (GH-#516)
- `MonitorField` - Change default to None when the field is nullable  by @gmcrocetti in -  (GH-#577)
- Explicitly re-export names from `__init__` module by @mthuurne in - (GH-#591)
- Switch from freezegun to time-machine. by @adamchainz in -  (GH-#510)
- USE_TZ = True by @foarsitter in -  (GH-#593)
- Remove redundant definition of `JoinManager` from tests by @mthuurne in -  (GH-#594)
- Pass reason to `@skip` decorator by @mthuurne in -  (GH-#595)
- Resolve name clash among test models by @mthuurne in -  (GH-#596)
- Remove obsolete `tests.signals` module by @mthuurne in -  (GH-#597)
- Remove obsolete test models by @mthuurne in -  (GH-#598)
- Postgresql docker container for local development by @foarsitter in -  (GH-#563)
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in -  (GH-#602)
- Add issue-manager by @foarsitter in -  (GH-#600)
- Translation files by @foarsitter in -  (GH-#608)

4.4.0 (2024-02-10)
------------------

- Add support for `Python 3.11` (GH-#545)
- Add support for `Python 3.12` (GH-#545)
- Drop support for `Python 3.7` (GH-#545)
- Add support for `Django 4.2`
- Add support for `Django 5.0`
- Remove ``SaveSignalHandlingModel``. This model used a modified copy of the internal Django method `Model.save_base()`
  and had not been updated for upstream bug fixes changes since its addition.
- Add Swedish translation
- Use proper column name instead of attname (GH-#573)
- Fix ValueError when calling prefetch_related for tracked ForeignKey fields

4.3.1 (2022-11-15)
------------------

- Confirm support for `Django 4.0`
- Add Spanish translation

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `5.0.0` | 2026-04-21 | Low | Imported from PyPI (5.0.0) |
| `5.0b0` | 2024-06-19 | Low | Beta release for testing the type hints |
| `4.5.1` | 2024-05-02 | Low | ## What's Changed * Remove `JoinQueryset.get_quoted_query()` by @mthuurne in https://github.com/jazzband/django-model-utils/pull/618  **Full Changelog**: https://github.com/jazzband/django-model-utils/compare/4.5.0...4.5.1 |
| `4.5.0` | 2024-04-01 | Low | ## What's Changed * Don't use `post_init` signal for initialize tracker by @meanmail in https://github.com/jazzband/django-model-utils/pull/556 * clarify docs for managers of SoftDeletableModel by @tadamcz in https://github.com/jazzband/django-model-utils/pull/589 * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/jazzband/django-model-utils/pull/575 * `Language Support` - Add translations for Brazilian Portuguese by @gmcrocetti in https://github.com/jazzband/dja |
| `4.4.0` | 2024-02-10 | Low | ## What's Changed * Add support for Python 3.11 (https://github.com/jazzband/django-model-utils/pull/545) * Add support for Python 3.12 (https://github.com/jazzband/django-model-utils/pull/545) * Add support for Django 4.2 (https://github.com/jazzband/django-model-utils/pull/562) * Add support for Django 5.0 (https://github.com/jazzband/django-model-utils/pull/583) * Remove SaveSignalHandlingModel. This model used a modified copy of the internal Django method Model.save_base() and had not b |
| `4.3.1` | 2023-06-16 | Low | - Confirm support for Django 4.0 (https://github.com/jazzband/django-model-utils/pull/513) - Add Spanish translation (https://github.com/jazzband/django-model-utils/pull/425) - Add French translation (https://github.com/jazzband/django-model-utils/pull/473) - Drop Django 1.7 workaround from select_subclasses() (https://github.com/jazzband/django-model-utils/pull/524) - Drop support for Django < 3.2 (https://github.com/jazzband/django-model-utils/pull/532) - Drop support for Python 3.6 (http |
| `4.2.0` | 2021-10-11 | Low | * Add support for Django 3.2 * Drop support for Django 3.0 * Add support for Python 3.10 * Added urlsafe token field. * Introduce context manager for FieldTracker state reset (GH-#491) * Fix performance regression of FieldTracker on FileField subclasses on Django 3.1+ (GH-#498) |
| `4.1.1` | 2021-04-08 | Low | - Applied `isort` to codebase (Refs GH-402) - Fix `TypeError` in save when model inherits from both TimeStampModel   and StatusModel. (Fixes GH-465) |
| `4.1.0` | 2021-04-08 | Low | - Update InheritanceQuerySetMixin to avoid querying too much tables - TimeStampedModel now automatically adds 'modified' field as an update_fields   parameter even if it is forgotten while using save() - `FieldTracker` now marks fields as not changed after `refresh_from_db` - `FieldTracker` now respects `update_fields` changed in overridden `save()`   method - Replace ugettext_lazy with gettext_lazy to satisfy Django deprecation warning - Add available_objects manager to SoftDeletableMode |
| `4.0.0` | 2019-12-11 | Low | ## 4.0.0 (2019-12-11)  - Remove hacks for previously supported Django versions. (Fixes GH-390) - Dropped support for Python 2.7. (Fixes GH-393) - Dropped usage of `six` - Drop support for `Django 1.11` - Add support for `Python 3.8` - Add support for `Django 3.0` |

## Citation

- HTML: https://www.freshcrate.ai/projects/django-model-utils
- Markdown: https://www.freshcrate.ai/projects/django-model-utils.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/django-model-utils/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
