Django model mixins and utilities.
Find a file
Daniel Andrlik 25743141bc Ensure TimeStampedModel modified equals created on initial creation. (#319)
*  Ensure TimeStampedModel modified equals created on initial creation.

Add logic to AutoLastModifiedField which checks to see if the associated created field of the correct cField class type is also present. If the instance has not yet been saved (missing a pk), then set the value to modified to be equal to created.

Fixes #247

📚 Update changes and authors list related to changes.

* 🚑 Set TimeStampedModel modified to be equal to created during first save.

If instance does not yet have a pk, before defaulting the last modified to the current time, iterate over the the fields of the model, and instead use whatever value is found in the first occurance of the AutoCreatedField.

Fixes #247

* Move changelog up to unreleased section.
2018-12-08 12:23:04 +06:00
.github Pull request and issue template fixes #254 2017-01-17 22:34:04 +00:00
docs Add a JoinManager that helps with performance (#351) 2018-11-25 20:18:23 +06:00
model_utils Ensure TimeStampedModel modified equals created on initial creation. (#319) 2018-12-08 12:23:04 +06:00
tests Ensure TimeStampedModel modified equals created on initial creation. (#319) 2018-12-08 12:23:04 +06:00
.coveragerc Add a JoinManager that helps with performance (#351) 2018-11-25 20:18:23 +06:00
.editorconfig Add EditorConfig file 2013-05-20 22:38:00 -07:00
.gitignore Add script and makefile tasks for making and compiling messages; un-gitignore .mo files. 2015-07-20 10:20:11 -06:00
.hgignore Add runtests.sh script to run tox and generate HTML coverage summary. 2013-01-27 13:35:48 -08:00
.hgtags Added tag 1.1.0 for changeset 92792fb14a51 2012-04-13 17:33:51 -06:00
.travis.yml Add a JoinManager that helps with performance (#351) 2018-11-25 20:18:23 +06:00
AUTHORS.rst Ensure TimeStampedModel modified equals created on initial creation. (#319) 2018-12-08 12:23:04 +06:00
CHANGES.rst Ensure TimeStampedModel modified equals created on initial creation. (#319) 2018-12-08 12:23:04 +06:00
CONTRIBUTING.rst Add jazzband badge/contributing guidelines. 2017-04-15 08:50:55 -07:00
LICENSE.txt Happy New Year! 2015-06-28 19:04:27 -07:00
Makefile Add script and makefile tasks for making and compiling messages; un-gitignore .mo files. 2015-07-20 10:20:11 -06:00
MANIFEST.in Include runtests.py in sdist; bump version to 2.5.2. 2016-08-09 15:06:49 -06:00
README.rst Add a JoinManager that helps with performance (#351) 2018-11-25 20:18:23 +06:00
requirements-test.txt Add a JoinManager that helps with performance (#351) 2018-11-25 20:18:23 +06:00
requirements.txt Fixes #231 -- clarify that requirements.txt contains dev dependencies. 2016-08-10 07:07:55 -06:00
setup.cfg switch to py.test + pytest-cov 2017-12-11 08:11:55 -06:00
setup.py Simplify version mentioning in README, classifiers 2017-12-17 07:38:16 -06:00
tox.ini Add a JoinManager that helps with performance (#351) 2018-11-25 20:18:23 +06:00
translations.py Exclude tests from distribution 2017-02-15 23:00:10 +00:00

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

.. image:: https://jazzband.co/static/img/badge.svg
   :target: https://jazzband.co/
   :alt: Jazzband
.. image:: https://travis-ci.org/jazzband/django-model-utils.svg?branch=master
   :target: https://travis-ci.org/jazzband/django-model-utils
.. 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

Django model mixins and utilities.

``django-model-utils`` supports `Django`_ 1.8 to 2.1.

.. _Django: http://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