django-model-utils


Namedjango-model-utils JSON
Version 4.5.1 PyPI version JSON
download
home_pagehttps://github.com/jazzband/django-model-utils
SummaryDjango model mixins and utilities
upload_time2024-05-02 22:55:58
maintainerJazzBand
docs_urlNone
authorCarl Meyer
requires_python>=3.8
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ==================
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/


Run tests
---------

.. code-block

    pip install -e .
    py.test

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
=========

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
- Add French translation
- Drop Django 1.7 workaround from `select_subclasses()`
- Drop support for `Django < 3.2`
- Drop support for `Python 3.6`
- Confirm support for `Django 4.1`

4.3.0
-----

- Never released due to packaging issues.

4.2.0 (2021-10-11)
------------------

- 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 (2020-12-01)
------------------

- 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 (2020-11-29)
------------------

**Breaking changes:**

- `FieldTracker` now marks fields as not changed after `refresh_from_db`
  respecting `fields` argument (GH-#404)
- `FieldTracker` now respects `update_fields` changed in overridden `save()`
  method (GH-#404)
- `FieldTracker` now resets states after `pre_save()` and not anymore `save()`
  signals, possibly altering the behaviour of overridden `save()`
  methods (GH-#404)

**Other changes:**

- 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()
- Replace ugettext_lazy with gettext_lazy to satisfy Django deprecation warning
- Add available_objects manager to SoftDeletableModel and add deprecation
  warning to objects manager.
- StatusModel now automatically adds 'status_changed' field during save as an
  update_fieldsparameter when 'status' is present in it to make sure it is not
  forgotten.
- Update test requirements
- Move tests to GitHub Actions: https://github.com/jazzband/django-model-utils/actions
- Drop support for `Django 2.1`
- Add support for `Python 3.9`
- Add support for `Django 3.1`

4.0.0 (2019-12-11)
------------------
- Added `Choices.subset`.
- 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`

3.2.0 (2019.06.21)
-------------------
- Catch `AttributeError` for deferred abstract fields, fixes GH-331.
- Update documentation to explain usage of `timeframed` model manager, fixes GH-118
- Honor `OneToOneField.parent_link=False`.
- Fix handling of deferred attributes on Django 1.10+, fixes GH-278
- Fix `FieldTracker.has_changed()` and `FieldTracker.previous()` to return
  correct responses for deferred fields.
- Add Simplified Chinese translations.
- Update AutoLastModifiedField so that at instance creation it will
  always be set equal to created to make querying easier. Fixes GH-254
- Support `reversed` for all kinds of `Choices` objects, fixes GH-309
- Fix Model instance non picklable GH-330
- Fix patched `save` in FieldTracker
- Upgrades test requirements (pytest, pytest-django, pytest-cov) and
  skips tox test with Python 3.5 and Django (trunk)
- Add UUIDModel and UUIDField support.

3.1.2 (2018.05.09)
------------------
- Update InheritanceIterable to inherit from
  ModelIterable instead of BaseIterable, fixes GH-277.

- Add all_objects Manager for 'SoftDeletableModel' to include soft
  deleted objects on queries as per issue GH-255

3.1.1 (2017.12.17)
------------------

- Update classifiers and README via GH-306, fixes GH-305

3.1.0 (2017.12.11)
------------------

- Support for Django 2.0 via GH-298, fixes GH-297
- Remove old travis script via GH-300
- Fix codecov and switch to py.test #301

3.0.0 (2017.04.13)
------------------

- Drop support for Python 2.6.
- Drop support for Django 1.4, 1.5, 1.6, 1.7.
- Exclude tests from the distribution, fixes GH-258.
- Add support for Django 1.11 GH-269
- Add a new model to disable pre_save/post_save signals


2.6.1 (2017.01.11)
------------------

- Fix infinite recursion with multiple `MonitorField` and `defer()` or `only()`
  on Django 1.10+. Thanks Romain Garrigues. Merge of GH-242, fixes GH-241.

- Fix `InheritanceManager` and `SoftDeletableManager` to respect
  `self._queryset_class` instead of hardcoding the queryset class. Merge of
  GH-250, fixes GH-249.

- Add mixins for `SoftDeletableQuerySet` and `SoftDeletableManager`, as stated
  in the the documentation.

- Fix `SoftDeletableModel.delete()` to use the correct database connection.
  Merge of GH-239.

- Added boolean keyword argument `soft` to `SoftDeletableModel.delete()` that
  revert to default behavior when set to `False`. Merge of GH-240.

- Enforced default manager in `StatusModel` to avoid manager order issues when
  using abstract models that redefine `objects` manager. Merge of GH-253, fixes
  GH-251.


2.6 (2016.09.19)
----------------

- Added `SoftDeletableModel` abstract class, its manageer
  `SoftDeletableManager` and queryset `SoftDeletableQuerySet`.

- Fix issue with field tracker and deferred FileField for Django 1.10.


2.5.2 (2016.08.09)
------------------

- Include `runtests.py` in sdist.


2.5.1 (2016.08.03)
------------------

- Fix `InheritanceQuerySet` raising an `AttributeError` exception
  under Django 1.9.

- Django 1.10 support regressed with changes between pre-alpha and final
  release; 1.10 currently not supported.


2.5 (2016.04.18)
----------------

- Drop support for Python 3.2.

- Add support for Django 1.10 pre-alpha.

- Track foreign keys on parent models properly when a tracker
  is defined on a child model. Fixes GH-214.


2.4 (2015.12.03)
----------------

- Remove `PassThroughManager`. Use Django's built-in `QuerySet.as_manager()`
  and/or `Manager.from_queryset()` utilities instead.

- Add support for Django 1.9.


2.3.1 (2015-07-20)
------------------

- Remove all translation-related automation in `setup.py`. Fixes GH-178 and
  GH-179. Thanks Joe Weiss, Matt Molyneaux, and others for the reports.


2.3 (2015.07.17)
----------------

- Keep track of deferred fields on model instance instead of on
  FieldInstanceTracker instance. Fixes accessing deferred fields for multiple
  instances of a model from the same queryset. Thanks Bram Boogaard. Merge of
  GH-151.

- Fix Django 1.7 migrations compatibility for SplitField. Thanks ad-m. Merge of
  GH-157; fixes GH-156.

- Add German translations.

- Django 1.8 compatibility.


2.2 (2014.07.31)
----------------

- Revert GH-130, restoring ability to access ``FieldTracker`` changes in
  overridden ``save`` methods or ``post_save`` handlers. This reopens GH-83
  (inability to pickle models with ``FieldTracker``) until a solution can be
  found that doesn't break behavior otherwise. Thanks Brian May for the
  report. Fixes GH-143.


2.1.1 (2014.07.28)
------------------

- ASCII-fold all non-ASCII characters in changelog; again. Argh. Apologies to
  those whose names are mangled by this change. It seems that distutils makes
  it impossible to handle non-ASCII content reliably under Python 3 in a
  setup.py long_description, when the system encoding may be ASCII. Thanks
  Brian May for the report. Fixes GH-141.


2.1.0 (2014.07.25)
------------------

- Add support for Django's built-in migrations to ``MonitorField`` and
  ``StatusField``.

- ``PassThroughManager`` now has support for seeing exposed methods via
  ``dir``, allowing `IPython`_ tab completion to be useful. Merge of GH-104,
  fixes GH-55.

- Add pickle support for models using ``FieldTracker``.  Thanks Ondrej Slintak
  for the report.  Thanks Matthew Schinckel for the fix.  Merge of GH-130,
  fixes GH-83.

.. _IPython: https://ipython.org/


2.0.3 (2014.03.19)
-------------------

- Fix ``get_query_set`` vs ``get_queryset`` in ``PassThroughManager`` for
  Django <1.6. Fixes issues with related managers not filtering by relation
  properly. Thanks whop, Bojan Mihelac, Daniel Shapiro, and Matthew Schinckel
  for the report; Matthew for the fix. Merge of GH-121.

- Fix ``FieldTracker`` with deferred model attributes. Thanks Michael van
  Tellingen. Merge of GH-115.

- Fix ``InheritanceManager`` with self-referential FK; avoid infinite
  recursion. Thanks rsenkbeil. Merge of GH-114.

2.0.2 (2014.02.19)
-------------------

- ASCII-fold all non-ASCII characters in changelog. Apologies to those whose
  names are mangled by this change. It seems that distutils makes it impossible
  to handle non-ASCII content reliably under Python 3 in a setup.py
  long_description, when the system encoding may be ASCII. Thanks Simone Dalla
  for the report. Fixes GH-113.


2.0.1 (2014.02.11)
-------------------

- Fix dependency to be on "Django" rather than "django", which plays better
  with static PyPI mirrors. Thanks Travis Swicegood.

- Fix issue with attempt to access ``__slots__`` when copying
  ``PassThroughManager``. Thanks Patryk Zawadzki. Merge of GH-105.

- Improve ``InheritanceManager`` so any attributes added by using extra(select)
  will be propagated onto children. Thanks Curtis Maloney. Merge of GH-101,
  fixes GH-34.

- Added ``InheritanceManagerMixin``, ``InheritanceQuerySetMixin``,
  ``PassThroughManagerMixin``, and ``QueryManagerMixin`` to allow composing
  their functionality with other custom manager/queryset subclasses (e.g. those
  in GeoDjango). Thanks Douglas Meehan!


2.0 (2014.01.06)
----------------

- BACKWARDS-INCOMPATIBLE: Indexing into a ``Choices`` instance now translates
  database representations to human-readable choice names, rather than simply
  indexing into an array of choice tuples. (Indexing into ``Choices`` was
  previously not documented.) If you have code that is relying on indexing or
  slicing ``Choices``, the simplest workaround is to change e.g. ``STATUS[1:]``
  to ``list(STATUS)[1:]``.

- Fixed bug with checking for field name conflicts for added query managers on
  `StatusModel`.

- Can pass `choices_name` to `StatusField` to use a different name for
  choices class attribute. ``STATUS`` is used by default.

- Can pass model subclasses, rather than strings, into
  `select_subclasses()`. Thanks Keryn Knight. Merge of GH-79.

- Deepcopying a `Choices` instance no longer fails with infinite recursion in
  `getattr`. Thanks Leden. Merge of GH-75.

- `get_subclass()` method is now available on both managers and
  querysets. Thanks Travis Swicegood. Merge of GH-82.

- Fix bug in `InheritanceManager` with grandchild classes on Django 1.6+;
  `select_subclasses('child', 'child__grandchild')` would only ever get to the
  child class. Thanks Keryn Knight for report and proposed fix.

- MonitorField now accepts a 'when' parameter. It will update only when the field
  changes to one of the values specified.


1.5.0 (2013.08.29)
------------------

- `Choices` now accepts option-groupings. Fixes GH-14.

- `Choices` can now be added to other `Choices` or to any iterable, and can be
  compared for equality with itself. Thanks Tony Aldridge. (Merge of GH-76.)

- `Choices` now `__contains__` its Python identifier values. Thanks Keryn
  Knight. (Merge of GH-69).

- Fixed a bug causing ``KeyError`` when saving with the parameter
  ``update_fields`` in which there are untracked fields. Thanks Mikhail
  Silonov. (Merge of GH-70, fixes GH-71).

- Fixed ``FieldTracker`` usage on inherited models.  Fixes GH-57.

- Added mutable field support to ``FieldTracker`` (Merge of GH-73, fixes GH-74)


1.4.0 (2013.06.03)
------------------

- Introduced ``FieldTracker`` as replacement for ``ModelTracker``, which is now
  deprecated.

- ``PassThroughManager.for_queryset_class()`` no longer ignores superclass
  ``get_query_set``. Thanks Andy Freeland.

- Fixed ``InheritanceManager`` bug with grandchildren in Django 1.6. Thanks
  CrazyCasta.

- Fixed lack of ``get_FOO_display`` method for ``StatusField``. Fixes GH-41.


1.3.1 (2013.04.11)
------------------

- Added explicit default to ``BooleanField`` in tests, for Django trunk
  compatibility.

- Fixed intermittent ``StatusField`` bug.  Fixes GH-29.

- Added Python 3 support.

- Dropped support for Django 1.2 and 1.3.  Django 1.4.2+ required.


1.3.0 (2013.03.27)
------------------

- Allow specifying default value for a ``StatusField``. Thanks Felipe
  Prenholato.

- Fix calling ``create()`` on a ``RelatedManager`` that subclasses a dynamic
  ``PassThroughManager``. Thanks SeiryuZ for the report. Fixes GH-24.

- Add workaround for https://code.djangoproject.com/ticket/16855 in
  InheritanceQuerySet to avoid overriding prior calls to
  ``select_related()``. Thanks ivirabyan.

- Added support for arbitrary levels of model inheritance in
  InheritanceManager. Thanks ivirabyan. (This feature only works in Django
  1.6+ due to https://code.djangoproject.com/ticket/16572).

- Added ``ModelTracker`` for tracking field changes between model saves. Thanks
  Trey Hunner.


1.2.0 (2013.01.27)
------------------

- Moved primary development from `Bitbucket`_ to `GitHub`_. Bitbucket mirror
  will continue to receive updates; Bitbucket issue tracker will be closed once
  all issues tracked in it are resolved.

.. _BitBucket: https://bitbucket.org/carljm/django-model-utils/overview
.. _GitHub: https://github.com/carljm/django-model-utils/

- Removed deprecated ``ChoiceEnum``, ``InheritanceCastModel``,
  ``InheritanceCastManager``, and ``manager_from``.

- Fixed pickling of ``PassThroughManager``. Thanks Rinat Shigapov.

- Set ``use_for_related_fields = True`` on ``QueryManager``.

- Added ``__len__`` method to ``Choices``. Thanks Ryan Kaskel and James Oakley.

- Fixed ``InheritanceQuerySet`` on Django 1.5. Thanks Javier Garcia Sogo.

1.1.0 (2012.04.13)
------------------

- Updated AutoCreatedField, AutoLastModifiedField, MonitorField, and
  TimeFramedModel to use ``django.utils.timezone.now`` on Django 1.4.
  Thanks Donald Stufft.

- Fixed annotation of InheritanceQuerysets. Thanks Jeff Elmore and Facundo
  Gaich.

- Dropped support for Python 2.5 and Django 1.1. Both are no longer supported
  even for security fixes, and should not be used.

- Added ``PassThroughManager.for_queryset_class()``, which fixes use of
  ``PassThroughManager`` with related fields. Thanks Ryan Kaskel for report and
  fix.

- Added ``InheritanceManager.get_subclass()``. Thanks smacker.

1.0.0 (2011.06.16)
------------------

- Fixed using SplitField on an abstract base model.

- Fixed issue #8, adding ``use_for_related_fields = True`` to
  ``InheritanceManager``.

- Added ``PassThroughManager``. Thanks Paul McLanahan.

- Added pending-deprecation warnings for ``InheritanceCastModel``,
  ``manager_from``, and Django 1.1 support. Removed documentation for the
  deprecated utilities. Bumped ``ChoiceEnum`` from pending-deprecation to
  deprecation.

- Fixed issue #6, bug with InheritanceManager and descriptor fields (e.g.
  FileField).  Thanks zyegfryed for the fix and sayane for tests.

0.6.0 (2011.02.18)
------------------

- updated SplitField to define get_prep_value rather than get_db_prep_value.
  This avoids deprecation warnings on Django trunk/1.3, but makes SplitField
  incompatible with Django versions prior to 1.2.

- added InheritanceManager, a better approach to selecting subclass instances
  for Django 1.2+. Thanks Jeff Elmore.

- added InheritanceCastManager and InheritanceCastQuerySet, to allow bulk
  casting of a queryset to child types.  Thanks Gregor Muellegger.

0.5.0 (2010.09.24)
------------------

- added manager_from (thanks George Sakkis)
- added StatusField, MonitorField, TimeFramedModel, and StatusModel
  (thanks Jannis Leidel)
- deprecated ChoiceEnum and replaced with Choices

0.4.0 (2010.03.16)
------------------

- added SplitField
- added ChoiceEnum
- added South support for custom model fields

0.3.0
-----

- Added ``QueryManager``

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jazzband/django-model-utils",
    "name": "django-model-utils",
    "maintainer": "JazzBand",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Carl Meyer",
    "author_email": "carl@oddbird.net",
    "download_url": "https://files.pythonhosted.org/packages/c6/f3/77be195e7518b8a652c052cdc42e60135b56a9a460aa3bd8cb08d751c322/django_model_utils-4.5.1.tar.gz",
    "platform": null,
    "description": "==================\ndjango-model-utils\n==================\n\n.. image:: https://jazzband.co/static/img/badge.svg\n   :target: https://jazzband.co/\n   :alt: Jazzband\n.. image:: https://github.com/jazzband/django-model-utils/workflows/Test/badge.svg\n   :target: https://github.com/jazzband/django-model-utils/actions\n.. image:: https://codecov.io/gh/jazzband/django-model-utils/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/jazzband/django-model-utils\n.. image:: https://img.shields.io/pypi/v/django-model-utils.svg\n   :target: https://pypi.python.org/pypi/django-model-utils\n.. image:: https://img.shields.io/pypi/pyversions/django-model-utils.svg\n   :target: https://pypi.python.org/pypi/django-model-utils\n   :alt: Supported Python versions\n.. image:: https://img.shields.io/pypi/djversions/django-model-utils.svg\n   :target: https://pypi.org/project/django-model-utils/\n   :alt: Supported Django versions\n\nDjango model mixins and utilities.\n\n``django-model-utils`` supports `Django`_ 3.2+.\n\n.. _Django: https://www.djangoproject.com/\n\nThis app is available on `PyPI`_.\n\n.. _PyPI: https://pypi.python.org/pypi/django-model-utils/\n\nGetting Help\n============\n\nDocumentation for django-model-utils is available\nhttps://django-model-utils.readthedocs.io/\n\n\nRun tests\n---------\n\n.. code-block\n\n    pip install -e .\n    py.test\n\nContributing\n============\n\nPlease file bugs and send pull requests to the `GitHub repository`_ and `issue\ntracker`_. See `CONTRIBUTING.rst`_ for details.\n\n.. _GitHub repository: https://github.com/jazzband/django-model-utils/\n.. _issue tracker: https://github.com/jazzband/django-model-utils/issues\n.. _CONTRIBUTING.rst: https://github.com/jazzband/django-model-utils/blob/master/CONTRIBUTING.rst\n\n\nChangelog\n=========\n\n4.5.1 (2024-05-02)\n------------------\n- Remove `JoinQueryset.get_quoted_query()` by @mthuurne (GH-#618)\n\n4.5.0 (2024-04-01)\n------------------\n- Don't use `post_init` signal for initialize tracker by @meanmail in -  (GH-#556)\n- clarify docs for managers of SoftDeletableModel by @tadamcz in -  (GH-#589)\n- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in -  (GH-#575)\n- `Language Support` - Add translations for Brazilian Portuguese by @gmcrocetti in -  (GH-#578)\n- Remove dead `init_deferred_fields` method by @joecox in -  (GH-#580)\n- Update where `ConnectionDoesNotExist` is imported from by @mthuurne in -  (GH-#566)\n- Remove arguments from `InheritanceQuerySetMixin._clone()` by @mthuurne in -  (GH-#567)\n- Allow running tests using sqlite by @jayvdb in -  (GH-#516)\n- `MonitorField` - Change default to None when the field is nullable  by @gmcrocetti in -  (GH-#577)\n- Explicitly re-export names from `__init__` module by @mthuurne in - (GH-#591)\n- Switch from freezegun to time-machine. by @adamchainz in -  (GH-#510)\n- USE_TZ = True by @foarsitter in -  (GH-#593)\n- Remove redundant definition of `JoinManager` from tests by @mthuurne in -  (GH-#594)\n- Pass reason to `@skip` decorator by @mthuurne in -  (GH-#595)\n- Resolve name clash among test models by @mthuurne in -  (GH-#596)\n- Remove obsolete `tests.signals` module by @mthuurne in -  (GH-#597)\n- Remove obsolete test models by @mthuurne in -  (GH-#598)\n- Postgresql docker container for local development by @foarsitter in -  (GH-#563)\n- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in -  (GH-#602)\n- Add issue-manager by @foarsitter in -  (GH-#600)\n- Translation files by @foarsitter in -  (GH-#608)\n\n4.4.0 (2024-02-10)\n------------------\n\n- Add support for `Python 3.11` (GH-#545)\n- Add support for `Python 3.12` (GH-#545)\n- Drop support for `Python 3.7` (GH-#545)\n- Add support for `Django 4.2`\n- Add support for `Django 5.0`\n- Remove ``SaveSignalHandlingModel``. This model used a modified copy of the internal Django method `Model.save_base()`\n  and had not been updated for upstream bug fixes changes since its addition.\n- Add Swedish translation\n- Use proper column name instead of attname (GH-#573)\n- Fix ValueError when calling prefetch_related for tracked ForeignKey fields\n\n4.3.1 (2022-11-15)\n------------------\n\n- Confirm support for `Django 4.0`\n- Add Spanish translation\n- Add French translation\n- Drop Django 1.7 workaround from `select_subclasses()`\n- Drop support for `Django < 3.2`\n- Drop support for `Python 3.6`\n- Confirm support for `Django 4.1`\n\n4.3.0\n-----\n\n- Never released due to packaging issues.\n\n4.2.0 (2021-10-11)\n------------------\n\n- Add support for `Django 3.2`\n- Drop support for `Django 3.0`\n- Add support for `Python 3.10`\n- Added urlsafe token field.\n- Introduce context manager for FieldTracker state reset (GH-#491)\n- Fix performance regression of FieldTracker on FileField subclasses on Django 3.1+\n  (GH-#498)\n\n4.1.1 (2020-12-01)\n------------------\n\n- Applied `isort` to codebase (Refs GH-#402)\n- Fix `TypeError` in save when model inherits from both TimeStampModel\n  and StatusModel. (Fixes GH-465)\n\n4.1.0 (2020-11-29)\n------------------\n\n**Breaking changes:**\n\n- `FieldTracker` now marks fields as not changed after `refresh_from_db`\n  respecting `fields` argument (GH-#404)\n- `FieldTracker` now respects `update_fields` changed in overridden `save()`\n  method (GH-#404)\n- `FieldTracker` now resets states after `pre_save()` and not anymore `save()`\n  signals, possibly altering the behaviour of overridden `save()`\n  methods (GH-#404)\n\n**Other changes:**\n\n- Update InheritanceQuerySetMixin to avoid querying too much tables\n- TimeStampedModel now automatically adds 'modified' field as an update_fields\n  parameter even if it is forgotten while using save()\n- Replace ugettext_lazy with gettext_lazy to satisfy Django deprecation warning\n- Add available_objects manager to SoftDeletableModel and add deprecation\n  warning to objects manager.\n- StatusModel now automatically adds 'status_changed' field during save as an\n  update_fieldsparameter when 'status' is present in it to make sure it is not\n  forgotten.\n- Update test requirements\n- Move tests to GitHub Actions: https://github.com/jazzband/django-model-utils/actions\n- Drop support for `Django 2.1`\n- Add support for `Python 3.9`\n- Add support for `Django 3.1`\n\n4.0.0 (2019-12-11)\n------------------\n- Added `Choices.subset`.\n- Remove hacks for previously supported Django versions. (Fixes GH-390)\n- Dropped support for Python 2.7. (Fixes GH-393)\n- Dropped usage of `six`\n- Drop support for `Django 1.11`\n- Add support for `Python 3.8`\n- Add support for `Django 3.0`\n\n3.2.0 (2019.06.21)\n-------------------\n- Catch `AttributeError` for deferred abstract fields, fixes GH-331.\n- Update documentation to explain usage of `timeframed` model manager, fixes GH-118\n- Honor `OneToOneField.parent_link=False`.\n- Fix handling of deferred attributes on Django 1.10+, fixes GH-278\n- Fix `FieldTracker.has_changed()` and `FieldTracker.previous()` to return\n  correct responses for deferred fields.\n- Add Simplified Chinese translations.\n- Update AutoLastModifiedField so that at instance creation it will\n  always be set equal to created to make querying easier. Fixes GH-254\n- Support `reversed` for all kinds of `Choices` objects, fixes GH-309\n- Fix Model instance non picklable GH-330\n- Fix patched `save` in FieldTracker\n- Upgrades test requirements (pytest, pytest-django, pytest-cov) and\n  skips tox test with Python 3.5 and Django (trunk)\n- Add UUIDModel and UUIDField support.\n\n3.1.2 (2018.05.09)\n------------------\n- Update InheritanceIterable to inherit from\n  ModelIterable instead of BaseIterable, fixes GH-277.\n\n- Add all_objects Manager for 'SoftDeletableModel' to include soft\n  deleted objects on queries as per issue GH-255\n\n3.1.1 (2017.12.17)\n------------------\n\n- Update classifiers and README via GH-306, fixes GH-305\n\n3.1.0 (2017.12.11)\n------------------\n\n- Support for Django 2.0 via GH-298, fixes GH-297\n- Remove old travis script via GH-300\n- Fix codecov and switch to py.test #301\n\n3.0.0 (2017.04.13)\n------------------\n\n- Drop support for Python 2.6.\n- Drop support for Django 1.4, 1.5, 1.6, 1.7.\n- Exclude tests from the distribution, fixes GH-258.\n- Add support for Django 1.11 GH-269\n- Add a new model to disable pre_save/post_save signals\n\n\n2.6.1 (2017.01.11)\n------------------\n\n- Fix infinite recursion with multiple `MonitorField` and `defer()` or `only()`\n  on Django 1.10+. Thanks Romain Garrigues. Merge of GH-242, fixes GH-241.\n\n- Fix `InheritanceManager` and `SoftDeletableManager` to respect\n  `self._queryset_class` instead of hardcoding the queryset class. Merge of\n  GH-250, fixes GH-249.\n\n- Add mixins for `SoftDeletableQuerySet` and `SoftDeletableManager`, as stated\n  in the the documentation.\n\n- Fix `SoftDeletableModel.delete()` to use the correct database connection.\n  Merge of GH-239.\n\n- Added boolean keyword argument `soft` to `SoftDeletableModel.delete()` that\n  revert to default behavior when set to `False`. Merge of GH-240.\n\n- Enforced default manager in `StatusModel` to avoid manager order issues when\n  using abstract models that redefine `objects` manager. Merge of GH-253, fixes\n  GH-251.\n\n\n2.6 (2016.09.19)\n----------------\n\n- Added `SoftDeletableModel` abstract class, its manageer\n  `SoftDeletableManager` and queryset `SoftDeletableQuerySet`.\n\n- Fix issue with field tracker and deferred FileField for Django 1.10.\n\n\n2.5.2 (2016.08.09)\n------------------\n\n- Include `runtests.py` in sdist.\n\n\n2.5.1 (2016.08.03)\n------------------\n\n- Fix `InheritanceQuerySet` raising an `AttributeError` exception\n  under Django 1.9.\n\n- Django 1.10 support regressed with changes between pre-alpha and final\n  release; 1.10 currently not supported.\n\n\n2.5 (2016.04.18)\n----------------\n\n- Drop support for Python 3.2.\n\n- Add support for Django 1.10 pre-alpha.\n\n- Track foreign keys on parent models properly when a tracker\n  is defined on a child model. Fixes GH-214.\n\n\n2.4 (2015.12.03)\n----------------\n\n- Remove `PassThroughManager`. Use Django's built-in `QuerySet.as_manager()`\n  and/or `Manager.from_queryset()` utilities instead.\n\n- Add support for Django 1.9.\n\n\n2.3.1 (2015-07-20)\n------------------\n\n- Remove all translation-related automation in `setup.py`. Fixes GH-178 and\n  GH-179. Thanks Joe Weiss, Matt Molyneaux, and others for the reports.\n\n\n2.3 (2015.07.17)\n----------------\n\n- Keep track of deferred fields on model instance instead of on\n  FieldInstanceTracker instance. Fixes accessing deferred fields for multiple\n  instances of a model from the same queryset. Thanks Bram Boogaard. Merge of\n  GH-151.\n\n- Fix Django 1.7 migrations compatibility for SplitField. Thanks ad-m. Merge of\n  GH-157; fixes GH-156.\n\n- Add German translations.\n\n- Django 1.8 compatibility.\n\n\n2.2 (2014.07.31)\n----------------\n\n- Revert GH-130, restoring ability to access ``FieldTracker`` changes in\n  overridden ``save`` methods or ``post_save`` handlers. This reopens GH-83\n  (inability to pickle models with ``FieldTracker``) until a solution can be\n  found that doesn't break behavior otherwise. Thanks Brian May for the\n  report. Fixes GH-143.\n\n\n2.1.1 (2014.07.28)\n------------------\n\n- ASCII-fold all non-ASCII characters in changelog; again. Argh. Apologies to\n  those whose names are mangled by this change. It seems that distutils makes\n  it impossible to handle non-ASCII content reliably under Python 3 in a\n  setup.py long_description, when the system encoding may be ASCII. Thanks\n  Brian May for the report. Fixes GH-141.\n\n\n2.1.0 (2014.07.25)\n------------------\n\n- Add support for Django's built-in migrations to ``MonitorField`` and\n  ``StatusField``.\n\n- ``PassThroughManager`` now has support for seeing exposed methods via\n  ``dir``, allowing `IPython`_ tab completion to be useful. Merge of GH-104,\n  fixes GH-55.\n\n- Add pickle support for models using ``FieldTracker``.  Thanks Ondrej Slintak\n  for the report.  Thanks Matthew Schinckel for the fix.  Merge of GH-130,\n  fixes GH-83.\n\n.. _IPython: https://ipython.org/\n\n\n2.0.3 (2014.03.19)\n-------------------\n\n- Fix ``get_query_set`` vs ``get_queryset`` in ``PassThroughManager`` for\n  Django <1.6. Fixes issues with related managers not filtering by relation\n  properly. Thanks whop, Bojan Mihelac, Daniel Shapiro, and Matthew Schinckel\n  for the report; Matthew for the fix. Merge of GH-121.\n\n- Fix ``FieldTracker`` with deferred model attributes. Thanks Michael van\n  Tellingen. Merge of GH-115.\n\n- Fix ``InheritanceManager`` with self-referential FK; avoid infinite\n  recursion. Thanks rsenkbeil. Merge of GH-114.\n\n2.0.2 (2014.02.19)\n-------------------\n\n- ASCII-fold all non-ASCII characters in changelog. Apologies to those whose\n  names are mangled by this change. It seems that distutils makes it impossible\n  to handle non-ASCII content reliably under Python 3 in a setup.py\n  long_description, when the system encoding may be ASCII. Thanks Simone Dalla\n  for the report. Fixes GH-113.\n\n\n2.0.1 (2014.02.11)\n-------------------\n\n- Fix dependency to be on \"Django\" rather than \"django\", which plays better\n  with static PyPI mirrors. Thanks Travis Swicegood.\n\n- Fix issue with attempt to access ``__slots__`` when copying\n  ``PassThroughManager``. Thanks Patryk Zawadzki. Merge of GH-105.\n\n- Improve ``InheritanceManager`` so any attributes added by using extra(select)\n  will be propagated onto children. Thanks Curtis Maloney. Merge of GH-101,\n  fixes GH-34.\n\n- Added ``InheritanceManagerMixin``, ``InheritanceQuerySetMixin``,\n  ``PassThroughManagerMixin``, and ``QueryManagerMixin`` to allow composing\n  their functionality with other custom manager/queryset subclasses (e.g. those\n  in GeoDjango). Thanks Douglas Meehan!\n\n\n2.0 (2014.01.06)\n----------------\n\n- BACKWARDS-INCOMPATIBLE: Indexing into a ``Choices`` instance now translates\n  database representations to human-readable choice names, rather than simply\n  indexing into an array of choice tuples. (Indexing into ``Choices`` was\n  previously not documented.) If you have code that is relying on indexing or\n  slicing ``Choices``, the simplest workaround is to change e.g. ``STATUS[1:]``\n  to ``list(STATUS)[1:]``.\n\n- Fixed bug with checking for field name conflicts for added query managers on\n  `StatusModel`.\n\n- Can pass `choices_name` to `StatusField` to use a different name for\n  choices class attribute. ``STATUS`` is used by default.\n\n- Can pass model subclasses, rather than strings, into\n  `select_subclasses()`. Thanks Keryn Knight. Merge of GH-79.\n\n- Deepcopying a `Choices` instance no longer fails with infinite recursion in\n  `getattr`. Thanks Leden. Merge of GH-75.\n\n- `get_subclass()` method is now available on both managers and\n  querysets. Thanks Travis Swicegood. Merge of GH-82.\n\n- Fix bug in `InheritanceManager` with grandchild classes on Django 1.6+;\n  `select_subclasses('child', 'child__grandchild')` would only ever get to the\n  child class. Thanks Keryn Knight for report and proposed fix.\n\n- MonitorField now accepts a 'when' parameter. It will update only when the field\n  changes to one of the values specified.\n\n\n1.5.0 (2013.08.29)\n------------------\n\n- `Choices` now accepts option-groupings. Fixes GH-14.\n\n- `Choices` can now be added to other `Choices` or to any iterable, and can be\n  compared for equality with itself. Thanks Tony Aldridge. (Merge of GH-76.)\n\n- `Choices` now `__contains__` its Python identifier values. Thanks Keryn\n  Knight. (Merge of GH-69).\n\n- Fixed a bug causing ``KeyError`` when saving with the parameter\n  ``update_fields`` in which there are untracked fields. Thanks Mikhail\n  Silonov. (Merge of GH-70, fixes GH-71).\n\n- Fixed ``FieldTracker`` usage on inherited models.  Fixes GH-57.\n\n- Added mutable field support to ``FieldTracker`` (Merge of GH-73, fixes GH-74)\n\n\n1.4.0 (2013.06.03)\n------------------\n\n- Introduced ``FieldTracker`` as replacement for ``ModelTracker``, which is now\n  deprecated.\n\n- ``PassThroughManager.for_queryset_class()`` no longer ignores superclass\n  ``get_query_set``. Thanks Andy Freeland.\n\n- Fixed ``InheritanceManager`` bug with grandchildren in Django 1.6. Thanks\n  CrazyCasta.\n\n- Fixed lack of ``get_FOO_display`` method for ``StatusField``. Fixes GH-41.\n\n\n1.3.1 (2013.04.11)\n------------------\n\n- Added explicit default to ``BooleanField`` in tests, for Django trunk\n  compatibility.\n\n- Fixed intermittent ``StatusField`` bug.  Fixes GH-29.\n\n- Added Python 3 support.\n\n- Dropped support for Django 1.2 and 1.3.  Django 1.4.2+ required.\n\n\n1.3.0 (2013.03.27)\n------------------\n\n- Allow specifying default value for a ``StatusField``. Thanks Felipe\n  Prenholato.\n\n- Fix calling ``create()`` on a ``RelatedManager`` that subclasses a dynamic\n  ``PassThroughManager``. Thanks SeiryuZ for the report. Fixes GH-24.\n\n- Add workaround for https://code.djangoproject.com/ticket/16855 in\n  InheritanceQuerySet to avoid overriding prior calls to\n  ``select_related()``. Thanks ivirabyan.\n\n- Added support for arbitrary levels of model inheritance in\n  InheritanceManager. Thanks ivirabyan. (This feature only works in Django\n  1.6+ due to https://code.djangoproject.com/ticket/16572).\n\n- Added ``ModelTracker`` for tracking field changes between model saves. Thanks\n  Trey Hunner.\n\n\n1.2.0 (2013.01.27)\n------------------\n\n- Moved primary development from `Bitbucket`_ to `GitHub`_. Bitbucket mirror\n  will continue to receive updates; Bitbucket issue tracker will be closed once\n  all issues tracked in it are resolved.\n\n.. _BitBucket: https://bitbucket.org/carljm/django-model-utils/overview\n.. _GitHub: https://github.com/carljm/django-model-utils/\n\n- Removed deprecated ``ChoiceEnum``, ``InheritanceCastModel``,\n  ``InheritanceCastManager``, and ``manager_from``.\n\n- Fixed pickling of ``PassThroughManager``. Thanks Rinat Shigapov.\n\n- Set ``use_for_related_fields = True`` on ``QueryManager``.\n\n- Added ``__len__`` method to ``Choices``. Thanks Ryan Kaskel and James Oakley.\n\n- Fixed ``InheritanceQuerySet`` on Django 1.5. Thanks Javier Garcia Sogo.\n\n1.1.0 (2012.04.13)\n------------------\n\n- Updated AutoCreatedField, AutoLastModifiedField, MonitorField, and\n  TimeFramedModel to use ``django.utils.timezone.now`` on Django 1.4.\n  Thanks Donald Stufft.\n\n- Fixed annotation of InheritanceQuerysets. Thanks Jeff Elmore and Facundo\n  Gaich.\n\n- Dropped support for Python 2.5 and Django 1.1. Both are no longer supported\n  even for security fixes, and should not be used.\n\n- Added ``PassThroughManager.for_queryset_class()``, which fixes use of\n  ``PassThroughManager`` with related fields. Thanks Ryan Kaskel for report and\n  fix.\n\n- Added ``InheritanceManager.get_subclass()``. Thanks smacker.\n\n1.0.0 (2011.06.16)\n------------------\n\n- Fixed using SplitField on an abstract base model.\n\n- Fixed issue #8, adding ``use_for_related_fields = True`` to\n  ``InheritanceManager``.\n\n- Added ``PassThroughManager``. Thanks Paul McLanahan.\n\n- Added pending-deprecation warnings for ``InheritanceCastModel``,\n  ``manager_from``, and Django 1.1 support. Removed documentation for the\n  deprecated utilities. Bumped ``ChoiceEnum`` from pending-deprecation to\n  deprecation.\n\n- Fixed issue #6, bug with InheritanceManager and descriptor fields (e.g.\n  FileField).  Thanks zyegfryed for the fix and sayane for tests.\n\n0.6.0 (2011.02.18)\n------------------\n\n- updated SplitField to define get_prep_value rather than get_db_prep_value.\n  This avoids deprecation warnings on Django trunk/1.3, but makes SplitField\n  incompatible with Django versions prior to 1.2.\n\n- added InheritanceManager, a better approach to selecting subclass instances\n  for Django 1.2+. Thanks Jeff Elmore.\n\n- added InheritanceCastManager and InheritanceCastQuerySet, to allow bulk\n  casting of a queryset to child types.  Thanks Gregor Muellegger.\n\n0.5.0 (2010.09.24)\n------------------\n\n- added manager_from (thanks George Sakkis)\n- added StatusField, MonitorField, TimeFramedModel, and StatusModel\n  (thanks Jannis Leidel)\n- deprecated ChoiceEnum and replaced with Choices\n\n0.4.0 (2010.03.16)\n------------------\n\n- added SplitField\n- added ChoiceEnum\n- added South support for custom model fields\n\n0.3.0\n-----\n\n- Added ``QueryManager``\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Django model mixins and utilities",
    "version": "4.5.1",
    "project_urls": {
        "Homepage": "https://github.com/jazzband/django-model-utils"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91c55d14bf2d55cb843e556b6283a2fbd6ea531cf7d2fa7b8d4f6d3abfada672",
                "md5": "0c326ae0964b70a1972418499bc94c01",
                "sha256": "f1141fc71796242edeffed5ad53a8cc57f00d345eb5a3a63e3f69401cd562ee2"
            },
            "downloads": -1,
            "filename": "django_model_utils-4.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0c326ae0964b70a1972418499bc94c01",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 39341,
            "upload_time": "2024-05-02T22:55:38",
            "upload_time_iso_8601": "2024-05-02T22:55:38.586299Z",
            "url": "https://files.pythonhosted.org/packages/91/c5/5d14bf2d55cb843e556b6283a2fbd6ea531cf7d2fa7b8d4f6d3abfada672/django_model_utils-4.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c6f377be195e7518b8a652c052cdc42e60135b56a9a460aa3bd8cb08d751c322",
                "md5": "aadfa8190540d75b8e86e85a3103a570",
                "sha256": "1220f22d9a467d53a1e0f4cda4857df0b2f757edf9a29955c42461988caa648a"
            },
            "downloads": -1,
            "filename": "django_model_utils-4.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "aadfa8190540d75b8e86e85a3103a570",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 75980,
            "upload_time": "2024-05-02T22:55:58",
            "upload_time_iso_8601": "2024-05-02T22:55:58.574795Z",
            "url": "https://files.pythonhosted.org/packages/c6/f3/77be195e7518b8a652c052cdc42e60135b56a9a460aa3bd8cb08d751c322/django_model_utils-4.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 22:55:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jazzband",
    "github_project": "django-model-utils",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "django-model-utils"
}
        
Elapsed time: 0.29995s