Commit graph

676 commits

Author SHA1 Message Date
Lucas Wiman
7d6b45f0c1 Increase coverage: verify that accessing the descriptor from the class yields the descriptor object. 2018-06-28 17:04:57 -07:00
Lucas Wiman
ca2fbb4ccd Fix coverage for a codepath only executed in <1.10 environments. 2018-06-28 16:59:30 -07:00
Lucas Wiman
cde1d706af Cover a branch in has_changed. 2018-06-28 14:08:03 -07:00
Lucas Wiman
59347ef36f Correctly clean up recursion sentinel value. 2018-06-28 13:52:52 -07:00
Lucas Wiman
c16a275bd7 Use --cov-append option in travis build to include coverage data from all tox environments run on the travis environment.
Note that it is run as one per python version, but multiple versions of django are tested in each.
2018-06-28 13:46:39 -07:00
Lucas Wiman
4740ab43ec Update passed environment variables to match codecov documentation.
Hopefully this will combine the coverage reports.
2018-06-28 13:41:09 -07:00
Lucas Wiman
15f9393bb2 Handle API change in DeferredAttribute descriptor in django-trunk.
This should maintain compatibility with the next version of django.
2018-06-28 13:16:33 -07:00
Lucas Wiman
a84c3afddd Fix behavior of .previous() in Django 1.10+.
The complications are that when the attribute is set in Django 1.10,
it no longer counts as a deferred attribute, and it is not retrieved from the database.
Naively updating __set__ to retrieve the value if it is deferred leads to infinite
recursion because accessing the attribute involves loading data from the database
and trying to set the attribute based on that value. This commit introduces
a somewhat hacky flag that records whether we're already trying to set
the attribute further up in the call stack.
2018-06-28 13:15:56 -07:00
Lucas Wiman
5d410e9ccc Fix test failures from merge. 2018-06-28 11:29:44 -07:00
Lucas Wiman
98a1366608 Merge branch 'defer-has-changed' into django-1.11-compatibility 2018-06-21 12:52:33 -07:00
Lucas Wiman
90ed7fc905 Improve coverage. 2018-06-21 12:41:42 -07:00
Lucas Wiman
be1a7d9281 Update AUTHORS and CHANGES.
As far as I can tell, no changes to documentation is required.
2018-06-21 12:41:42 -07:00
Lucas Wiman
80b099f129 Do not override custom descriptors when present.
This commit adds a collection of wrapper classes for tracking fields
while still using custom descriptors that may be present. This fixes
a bug where deferring a model field with a custom descriptor meant
that the descriptor was overridden in all subsequent queries.
2018-06-21 12:41:42 -07:00
Lucas Wiman
be52bc9290 Add failing test for deferred attributes. 2018-06-21 12:41:42 -07:00
Lucas Wiman
0fc0b44c95 Remove version checks for django<1.8.
Support for older versions of django was dropped in 3.0.0.
2018-06-21 12:41:42 -07:00
João Amaro
6d2ba63387 update changelog and versions for 3.1.2 2018-05-09 14:45:37 -03:00
Hanley Hansen
18dfb6b2cf
Merge pull request #279 from hanleyhansen/inheritance-iterable
Update InheritanceIterable to inherit from ModelIterable instead of BaseIterable
2018-05-02 14:14:22 -04:00
Jack Cushman
d34043fd25 Avoid fetching deferred fields in has_changed 2018-02-10 10:53:36 -05:00
Jannis Leidel
1eff6d0d8f
Add project release info to Travis config. 2018-01-10 10:59:29 +01:00
Jannis Leidel
a4afe46051
Merge pull request #308 from jazzband/tox-travis
Simplified tox setup with tox-travis.
2018-01-10 10:58:21 +01:00
Jannis Leidel
ccaa08d12e
Simplified tox setup with tox-travis. 2018-01-10 10:48:14 +01:00
Tony Narlock
7afacccd79
Merge pull request #306 from develtech/update-versions
Simplify version mentioning in README, classifiers
2017-12-17 07:50:22 -06:00
Tony Narlock
baa8bae1c0 update changelog and versions for 3.1.1 2017-12-17 07:45:56 -06:00
Tony Narlock
419fe216b7 Simplify version mentioning in README, classifiers
Remove Python version mentionings, as they are beholden to Django's
constraints.

See also:

- https://github.com/jazzband/django-model-utils/issues/305
2017-12-17 07:38:16 -06:00
Tony Narlock
78e837e572
Merge pull request #302 from develtech/codecov-btn
use codecov button on readme
2017-12-11 18:06:01 -06:00
Tony Narlock
fc13a6bd40 use codecov button on readme 2017-12-11 18:05:28 -06:00
Tony Narlock
8a0d00b939 tag 3.1.0 2017-12-11 08:27:41 -06:00
Tony Narlock
044cac0d68 pep8 + add django classifiers to setup.py 2017-12-11 08:22:59 -06:00
Tony Narlock
32259fb90b
Merge pull request #301 from develtech/codecov
Add codecov to travis, switch to py.test

This removes runtest.py.
2017-12-11 08:21:33 -06:00
Tony Narlock
28bd4567a7 switch to py.test + pytest-cov 2017-12-11 08:11:55 -06:00
Tony Narlock
6dd7556da7 add codecov to travis 2017-12-11 07:47:48 -06:00
Tony Narlock
4a7182112f update coveragerc to omit tests, dotfiles 2017-12-11 07:20:03 -06:00
Tony Narlock
6e74791f68
Merge pull request #300 from develtech/rm-update-travis-script
Remove update travis script
2017-12-11 07:15:44 -06:00
Tony Narlock
1f8e9f9fb3 rm update travis script, this can be done by hand 2017-12-11 07:15:06 -06:00
Tony Narlock
749aa09ff2
Merge pull request #298 from develtech/django-2.0
Django 2.0 support
2017-12-10 19:23:31 -06:00
Tony Narlock
35e17150b5 Overhaul travis/tox testbed #299
Passes in python version via travis python: param
2017-12-07 14:08:30 -06:00
Tony Narlock
c4d72123ef rm use_for_related_fields #290 2017-12-07 12:20:50 -06:00
Tony Narlock
a975f2f07b Add django 2.0 to travis and tox #297 2017-12-07 11:24:05 -06:00
Tony Narlock
a07140e771 Use _chain for django 2.0, #295 2017-12-07 11:13:39 -06:00
Hanley
8c935d3a83 update changes.rst 2017-06-23 09:56:51 -04:00
Hanley
0a809df4da make InheritanceIterable inherit from ModelIterable instead of BaseIterable 2017-06-23 09:51:32 -04:00
Jannis Leidel
343d459406 Updated some of the badges. 2017-04-18 10:51:18 +02:00
Carl Meyer
94c77d75ef Add jazzband badge/contributing guidelines. 2017-04-15 08:50:55 -07:00
Carl Meyer
198dcb612e Update github links for jazzband transfer. 2017-04-15 08:47:31 -07:00
Carl Meyer
100d2d7a24 Bump version to 3.0.1a1. 2017-04-13 16:51:52 -07:00
Carl Meyer
2e3b50dcb6 Bump version to 3.0.0. 2017-04-13 16:49:58 -07:00
Carl Meyer
f11646b10e Allow failure of py36 build for now, until Travis gets it 2017-04-13 16:47:48 -07:00
Carl Meyer
89c4a0fc44 Add testing on Python 3.6 and Django 1.11. 2017-04-13 16:39:21 -07:00
Carl Meyer
716e29d83b Merge pull request #270 from nakato/iter_class
Support django 1.11 iterator changes
2017-04-13 16:29:38 -07:00
Sachi King
8cb21aabbc Support django 1.11 iterator changes
Django starting with 1.9 switched to using a class to provide an
iterator for the querymanager.  Between 1.9 and 1.10 changes slowly
stopped referencing that function and instead started calling
_iterator_class directly.

As the functionality model-utils is patching has moved, this patch moves
the iterator logic to a class to match the changes that have been made
in Django in version 1.9.

As Django 1.8 is a LTS release that is still supported, iterator()
is retained in the InheritanceQuerySetMixin and can be removed when
support for Django 1.8 is removed.  This goes for the try-except in the
import statements as well.
2017-04-02 21:53:15 +10:00