Commit graph

447 commits

Author SHA1 Message Date
Maarten ter Huurne
2d7139363c Fix SoftDeletableModel.delete() forwarding positional args to superclass
The `soft` argument was made keyword-only, to avoid conflicts with new
positional arguments that might be added to Django. It was already
conflicting with the `keep_parents` argument.

The `using` argument is now passed to the superclass positionally,
as otherwise it can overlap with `*args`, resulting in a `TypeError`
on calls where `keep_parents` is passed positionally.
2024-04-11 16:45:32 +02:00
Maarten ter Huurne
a86c14e4e7
Remove excerpt field workaround for South FakeORM (#610)
* Remove excerpt field workaround for South FakeORM

South FakeORM hasn't been supported since fda2d39e, but the workaround
introduced in 9147becf evaded deletion. The `NoRendered` model was
removed in 9df3df99, but with that model gone, the `no_excerpt_field`
argument became obsolete as well.

* Document removal of `no_excerpt_field` in changelog
2024-04-10 14:17:34 +02:00
Maarten ter Huurne
62cecfeb25 Suppress error about __version__ being None when not installed
Suppress rather than annotate, because people type checking against
`django-model-utils` will always have it installed and therefore
should not have to deal with `__version__` being `None`.
2024-04-05 17:15:16 +02:00
Guilherme Martins Crocetti
4c9d6eee13
feat(monitor): Change default to None when the field is marked as nullable and no default is provided (#599) 2024-04-04 10:26:17 +02:00
Jelmer
714632e8bf
Merge pull request #590 from foarsitter/unused_variable_levels
Levels variable is never set
2024-04-03 08:58:54 +02:00
Jelmer
53941ec7b4
Merge pull request #604 from ProtixIT/property-decorators
Modernize property definitions in `SplitText`
2024-04-03 08:54:31 +02:00
Maarten ter Huurne
d320924383
Forward additional arguments to contribute_to_class() to Django (#605)
* Pass additional arguments to superclass `contribute_to_class()`

In Django 3.2 there is an additional argument `private_only` and more
could be added in future versions.
2024-04-03 08:53:52 +02:00
Jelmer
23ea25a3ca
Merge pull request #606 from ProtixIT/keyword-only-cleanup
Modernize the way some keyword-only arguments are implemented
2024-04-03 08:53:09 +02:00
Jelmer
89653b2d24
Merge pull request #607 from ProtixIT/cleanup-factory
Minor cleanup of the code handling `UrlsafeTokenField`'s `factory` argument
2024-04-03 08:52:26 +02:00
Jelmer Draaijer
c6d686e418 Translation files 2024-04-01 15:09:46 +02:00
Maarten ter Huurne
6c5ed66ef2 Use callable() builtin function over isinstance(..., Callable)
This is slightly more compact, but the main motivation is to work
around the following mypy bug:

https://github.com/python/mypy/issues/3060
2024-03-26 14:09:03 +01:00
Maarten ter Huurne
e34de65480 Fix error message of UrlsafeTokenField's factory arg check 2024-03-26 14:08:49 +01:00
Maarten ter Huurne
6c920508c1 Use keyword-only arguments to simplify a few __init__() methods
Keyword-only arguments can be used now that Python 2 is no longer
supported.
2024-03-26 13:53:02 +01:00
Maarten ter Huurne
d1325d1d5b Modernize property definitions in SplitText 2024-03-26 12:11:09 +01:00
Maarten ter Huurne
00e52e8508 Explicitly re-export names from __init__ module
Both mypy and flake8 understand `__all__`, removing the need for
warning suppression comments.
2024-03-22 14:50:31 +01:00
Guilherme Martins Crocetti
22015b8e69
chore(monitor-field): Add deprecation warning when the field is null and no default is provided. The new behavior will be introduced in a next major release 2024-03-21 20:05:14 -03:00
Jelmer Draaijer
ae562b45fb Remove unused code 2024-03-21 16:52:14 +01:00
Jelmer
89b7662fa8
Merge pull request #567 from ProtixIT/remove-clone-args
Remove arguments from `InheritanceQuerySetMixin._clone()`
2024-03-21 15:33:02 +01:00
Jelmer
7b8a58b871
Merge pull request #580 from joecox/remove-dead-tracker-code
Remove dead `init_deferred_fields` method
2024-03-21 08:47:53 +01:00
Jelmer
f39c975e8b
Merge branch 'master' into ptbr-translations 2024-03-21 08:36:00 +01:00
meanmail
5663374890 Don't use post_init signal for initialize tracker 2024-03-11 17:50:12 +01:00
Joseph Riddle
55cd816939
Merge branch 'master' into fix-prefetch-related 2023-11-27 12:55:53 -08:00
Adam Johnson
11f3a53b0f Remove SaveSignalHandlingModel 2023-10-26 16:56:30 +01:00
Joe Cox
b2a10bd96c remove dead init_deferred_fields method 2023-09-11 16:25:16 -07:00
Guilherme Martins Crocetti
055932bb8b
feat(locale): Add translations for pt_BR 2023-08-01 11:26:41 -03:00
Serhii Tereshchenko
0ec4ac5e38
fix: Use proper column name instead of attname (#573)
fix: Use proper column name instead of attname
2023-06-16 15:34:47 +02:00
Jelmer
6916342126
Merge pull request #552 from patrick91/master
Add py.typed file
2023-06-16 11:46:15 +02:00
Jelmer
23e7ee3382
Merge branch 'master' into swedish-translation 2023-06-16 11:25:36 +02:00
Hugo van Kemenade
b76c6c497b Replace setuptools' pkg_resources with stdlib importlib.metadata 2023-06-15 17:49:51 +03:00
Maarten ter Huurne
033fca4e2d Remove arguments from InheritanceQuerySetMixin._clone()
The `QuerySet._clone()` method has no arguments in either Django 3.2
or 4.1, so I'm assuming the arguments were necessary for a version
of Django that is no longer supported by `django-model-utils`.
2023-04-19 22:14:27 +02:00
Tomas Walch
41fd090e25 Swedish translation 2023-04-06 14:35:28 +02:00
joeriddles
a0624f1492 For error on prefetch_related for tracked field 2023-01-26 13:17:49 -08:00
Patrick Arminio
bfa95b1baf Add py.typed 2023-01-23 22:03:56 +00:00
Hasan Ramezani
0b5475e3d5 Add pyupgrade to pre-commit configurations 2022-08-17 23:08:31 +02:00
Adam Johnson
d699745504 Remove workaround from select_subclasess()
The workaround was for an issue that was fixed in Django 1.7: https://code.djangoproject.com/ticket/16855 / 349c12d3f5 .
2022-08-17 23:06:50 +02:00
Tim Gates
2dab8afded docs: Fix a few typos
There are small typos in:
- docs/managers.rst
- model_utils/managers.py
- tests/test_models/test_timestamped_model.py

Fixes:
- Should read `subclasses` rather than `subclasess`.
- Should read `queryset` rather than `querset`.
- Should read `permissible` rather than `permissable`.
- Should read `modified` rather than `modifed`.
- Should read `heterogeneous` rather than `heterogenous`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2022-08-17 22:37:49 +02:00
John Vandenberg
70b949cd2c
Merge branch 'master' into spanish_translation 2022-03-14 10:36:04 +08:00
John Vandenberg
53b23c84c5
Merge pull request #473 from Sicilia04/master
Adds French translation
2022-03-14 10:34:06 +08:00
Matthieu Rigal
a1920d2132
Merge pull request #499 from joshuadavidthomas/python3.10
Add support for Python 3.10
2021-10-09 22:45:12 +02:00
Matthieu Rigal
6d4112e8ce
Fix performance regression: avoid pickling the whole instance when deepcopying fields on Django 3.1+ (#500)
* test: Add failing test for #gh-498

* fix: Fix performance regression on FileTracker for FileField on Django 3.1+
2021-10-09 21:30:12 +06:00
tumb1er
dd0f62bdba Fix QuerySet._chain for django main (post-3.2) 2021-10-09 16:52:50 +06:00
Josh
8f4f24f88c fix Callable import
The ability to import from `collections` was removed in 3.10.
2021-10-08 09:05:33 -05:00
Sergey Tikhonov
79a7793dc5
#491 Context manager for resetting fields (#494)
* Add tracker context manager and decorator

* Handle auto-field warning in tests

* Use tracker context in monkey-patched methods

* Test delaying set_saved_fields call with context manager

* Docs for tracker context

* Describe FieldsContext context manager in changes

* Fix unused import

* #494 add breaking changes note on 4.1.1 release for #404

* #494 fix typo

* #494 add docstring for FieldsContext

* #494 move breaking changes from 4.1.1 to 4.1.0

* #494 fix typo and add some more docstrings
2021-10-08 15:09:20 +06:00
Nafees Anwar
9deb39dc46 Added deconstruct 2021-04-30 21:40:39 +05:00
Nafees Anwar
a56d07cd68 Added urlsafe token field 2021-04-30 21:40:39 +05:00
Florian Alu
3a1bcc7ccb Add French translation 2021-01-11 11:57:01 +01:00
Hasan Ramezani
2269f810c8 Fix TypeError in save when model inherits from both TimeStampModel and StatusModel. (Fixes GH-465) 2020-12-02 00:07:22 +01:00
David Smith
79ff8ea6be
Used isort to sort imports (#460) 2020-11-29 20:58:00 +00:00
Jannis Leidel
e630935fa3
Please coverage 2020-11-29 15:00:33 +01:00
Jannis Leidel
1336a91d75
Merge branch 'master' into gha 2020-11-29 14:42:23 +01:00