Commit graph

353 commits

Author SHA1 Message Date
JMP
2a47aa093d Pep8 review 2019-02-26 19:01:39 +01:00
JMP
da3c59a6df Fix SyntaxError for python 2.7 2019-02-26 18:38:39 +01:00
JMP
0d4facbb53 Merge branch 'feature/uuid_model' of github.com:marfyl/django-model-utils into feature/uuid_model 2019-02-26 18:01:20 +01:00
jmmp
e5955f780b
Update fields.py 2019-02-26 17:58:20 +01:00
JMP
2f142afd37 Fix imports pep8 2019-02-26 17:55:02 +01:00
JMP
015dd4831f Catch error with inherit class 2019-02-26 17:50:32 +01:00
JMP
533501753f UUID version custom exception 2019-02-26 17:36:59 +01:00
JMP
ca75294883 UUID field added 2019-02-26 17:33:06 +01:00
JMP
38f8932e74 UUID model added 2019-02-26 17:32:56 +01:00
Zach Cheung
af1824e200 fix conflict 2019-01-11 17:26:06 +08:00
Reece Dunham
3bf67aa4d9
Merge pull request #276 from ar7n/master
Russian locale added
2019-01-10 15:41:22 -05:00
Reece Dunham
6325951970
Merge pull request #325 from illagrenan/master
Add Czech (cs) translations
2019-01-10 15:40:55 -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
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
Zach Cheung
300209007b add Simplified Chinese translations 2018-10-23 15:38:04 +08: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
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
654e13235e Fix E303 too many blank lines. 2018-07-02 11:47:19 -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
59347ef36f Correctly clean up recursion sentinel value. 2018-06-28 13:52:52 -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
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
Václav Dohnal
a6ce9fcc3b add N/A as Language-Team 2018-05-04 13:51:46 +02:00
Václav Dohnal
db35475ece add link to the issue tracker on Github 2018-05-04 13:51:15 +02:00
Václav Dohnal
d7e8144d4c add missing file header 2018-05-04 13:50:58 +02:00
Václav Dohnal
248db7bde4 update czech (cs) translations 2018-05-04 13:46:16 +02:00
Václav Dohnal
b15f44c260 add czech (cs) translations 2018-05-04 13:45:53 +02: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
Tony Narlock
baa8bae1c0 update changelog and versions for 3.1.1 2017-12-17 07:45:56 -06:00
Tony Narlock
8a0d00b939 tag 3.1.0 2017-12-11 08:27:41 -06:00
Tony Narlock
c4d72123ef rm use_for_related_fields #290 2017-12-07 12:20:50 -06:00
Tony Narlock
a07140e771 Use _chain for django 2.0, #295 2017-12-07 11:13:39 -06:00
Hanley
0a809df4da make InheritanceIterable inherit from ModelIterable instead of BaseIterable 2017-06-23 09:51:32 -04:00
Arseny Sysolyatin
69d6c6040a Russian locale added 2017-05-22 20:23:24 +03:00