Commit graph

709 commits

Author SHA1 Message Date
Reece Dunham
4d9df911b3
Update year. 2019-01-10 15:38:56 -05:00
Sergey Tikhonov
6b88c888d3 fix model.save patched in FieldTracker (#353)
* fix model.save patched in FieldTracker

* add test for save call with args

* update changes
2018-12-10 21:35:26 +06:00
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
Guilherme Devincenzi
b739f6fe87 Add default manager as all_objects for SoftDeletableModel (#326)
* Add default manager as all_objects for SoftDeletableModel

* Document changes on changelog
2018-12-08 11:50:10 +06:00
Éric Araujo
764b7ea78d Add support for reverse iteration of Choices (#314) 2018-12-08 11:47:54 +06:00
Sebastian Illing
326bd7bc02 Fix missing subclasses and annotated in cloned InheritanceQueryset (#335)
Bug only occurs in django > 2
2018-12-08 11:26:36 +06:00
Jonathan Sundqvist
2cb773372d Add a JoinManager that helps with performance (#351)
* Add the join manager + tests

* Documentation for join manager

* Use order_by for consistent tests

* Use postgres instead sqlite for tests for better reliability

* Fix coverage

* Drop django 1.8
2018-11-25 20:18:23 +06:00
Asif Saif Uddin
08161456d5
Merge pull request #350 from tumb1er/patch_model_save
fix #330 patch MyModel.save instead of MyModel().save
2018-11-20 23:55:25 +06:00
tumb1er
ba83be0b43 fix #330 patch MyModel.save instead of MyModel().save 2018-11-20 18:32:09 +03:00
Asif Saif Uddin
05671695bb
update tag 2018-11-03 11:12:50 +06:00
Asif Saif Uddin
4c5c4b8bc4
Merge pull request #341 from thiras/master
Change supported version to 2.1 at README.rst (Fix #340)
2018-10-23 15:15:03 +06:00
Ant Somers
3efac688ed
Change supported version to 2.1 at README.rst 2018-10-05 02:43:52 +03:00
Asif Saif Uddin
4562da4e18
updated doc about supported python and django versions. 2018-09-24 19:39:33 +06:00
Asif Saif Uddin
e150d24f7a
Merge pull request #334 from rlmv/django-2.1
Add Django 2.1 to tox
2018-09-24 19:25:17 +06:00
Bo Marchman
df8ceed265 Add Django 2.1 to tox 2018-08-07 11:56:02 -04:00
Lucas Wiman
bf1adce0b8
Merge pull request #329 from lucaswiman/fix-pep8-violations
Fix pep8 violations
2018-07-25 15:00:11 -07:00
Lucas Wiman
c53b19e50d Ignore 80 character line length restriction of pep8.
It seems like this hasn't been consistently followed in this codebase,
and the number of changes was fairly large.
2018-07-02 14:33:47 -07:00
Lucas Wiman
9189d60996 Fix remaining non-E501 line length changes.
The E402 module level import appears to be an error of some kind in flake8?
2018-07-02 13:01:49 -07:00
Lucas Wiman
0859508a64 Fix E123 closing bracket does not match indentation of opening bracket's line 2018-07-02 12:57:14 -07:00
Lucas Wiman
e23e86a2be Ignore W503 line break before binary operator
It doesn't seem like following this rule will lead to clearer code in the violations in this codebase.
2018-07-02 12:52:47 -07:00
Lucas Wiman
da65d0be32 Fix E30X too-few line spacing errors. 2018-07-02 12:20:38 -07:00
Lucas Wiman
600ddc8dc5 Fix F401: imported but unused. 2018-07-02 12:16:41 -07:00
Lucas Wiman
679aed41a2 Remove unused __unicode__ method (dead code). 2018-07-02 11:52:05 -07:00
Lucas Wiman
954624cb22 Fix F841: local variable is assigned but never used. 2018-07-02 11:50:56 -07:00
Lucas Wiman
f845dcb24c Fix E231: missing whitespace after ",". 2018-07-02 11:49:16 -07:00
Lucas Wiman
654e13235e Fix E303 too many blank lines. 2018-07-02 11:47:19 -07:00
Lucas Wiman
9a6634b87a Ignore assigning to lambda warning. 2018-07-02 11:45:51 -07:00
Lucas Wiman
54543f1e8d Add a flake8 environment to ensure pep8 compatibility. 2018-07-02 11:43:38 -07:00
Lucas Wiman
16dec4d12d
Merge pull request #317 from lucaswiman/django-1.11-compatibility
Fix handling of deferred fields on django 1.10+
2018-07-02 11:30:09 -07:00
Lucas Wiman
2e92877910 Merge branch 'master' into django-1.11-compatibility 2018-07-02 11:21:48 -07:00
Martey Dodoo
e750fc7408 Fix AUTHORS.rst formatting.
Add pipe character at the beginning of each line so that all authors are
not concatenated together when ReStructuredText is parsed. Add Martey to
AUTHORS as well.
2018-06-30 16:18:16 -07:00
Harry Moreno
1197839765 Update docs to support django 2.0 2018-06-30 16:11:43 -07:00
Lucas Wiman
45502c0ec2
Put changelog in the right place. 2018-06-30 15:52:00 -07:00
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