Maarten ter Huurne
5fc37eb4b4
Provide type arguments to field base classes
2024-06-13 12:02:05 +02:00
Maarten ter Huurne
ebfb3455dc
Annotate the fields module
2024-06-13 12:02:05 +02:00
Maarten ter Huurne
0043fedf46
Enable postponed evaluation of annotations for all source modules
...
This allows using the latest annotation syntax supported by the type
checker regardless of the runtime Python version.
2024-06-13 12:02:05 +02:00
Maarten ter Huurne
db9336031e
Call Field.get_default() instead of _get_default()
...
We can call the inherited public method using `super()` instead of
calling the private method directly.
2024-06-13 12:02:05 +02:00
Maarten ter Huurne
c2d6cb5021
Remove support for assigning None to a SplitField
...
This behavior wasn't documented and didn't fully work: it breaks
as soon as you try to save a model with a `None` value.
2024-04-16 08:05:13 +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
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
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
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
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
Josh
8f4f24f88c
fix Callable import
...
The ability to import from `collections` was removed in 3.10.
2021-10-08 09:05:33 -05: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
David Smith
79ff8ea6be
Used isort to sort imports ( #460 )
2020-11-29 20:58:00 +00:00
Misha K
5aa40c66be
Add django 3.0 to the test matrix and drop six ( #395 )
...
* - add django 3.0 to the test matrix
- drop six
* add entry in CHANGES
* remove context kwarg
* fix test with DeferredAttribute
* rename StringyDescriptor's name to attname
* Fix flake8
* Drop support for Django 1.11 because the API are not compatibles anymore with Django 3.0
* Try to fix tests.
* Define model for the field mock.
* Simplifies the code.
* Properly mock the field.
* Typo
* Use the new API field name.
* Call it attname
* Grab the field instance from the model.
* Use postgres in travis tests.
* Django 2.0.1 minimum is needed.
* Update Changelog to tell about breaking Django 1.11.
* Update changelog to tell about Django 3.0 support.
* @natim review.
2019-12-09 19:37:16 +06:00
Adam Dobrawy
ffa1a85dc7
Modernize Python syntax, add Python 3.8 ( #398 )
...
* Modernize Python syntax, add Python 3.8
* Update Python version & dist in TravisCI
* Add postgresql as addon
* Switch to psycopg2-binary
* Drop django.utils.six
2019-11-14 22:50:04 +06:00
Hasan Ramezani
aa94194dbc
Drop Python 2 support. ( #394 )
2019-09-30 14:08:52 +06:00
Rémy HUBSCHER
e6c7b567d1
Remove unsupported django version hacks.
2019-08-21 11:02:23 +02:00
Rémy HUBSCHER
1878537f25
Merge branch 'master' into bugfix/issue_109
2019-08-20 13:46:07 +02:00
asday
d9aa34e498
Fixed spacing.
...
Extraneous whitespace, too many blank lines, and too few blank
lines.
2019-08-19 22:38:05 +01:00
jmmp
5ffcfe831c
Update fields.py
2019-02-27 02:29:47 +01:00
JMP
ce3a0e59f4
Use django exception instead custom one
2019-02-26 19:17:06 +01:00
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
015dd4831f
Catch error with inherit class
2019-02-26 17:50:32 +01:00
JMP
ca75294883
UUID field added
2019-02-26 17:33:06 +01: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
Lucas Wiman
da65d0be32
Fix E30X too-few line spacing errors.
2018-07-02 12:20:38 -07:00
Ryan P Kilby
e148c670d1
Fix django 2.0 warnings
2017-01-12 12:16:46 -05:00
Ryan P Kilby
fda2d39ec4
Drop unsupported django versions
2017-01-12 12:16:40 -05:00
romgar
93dd940a5d
Remove defered fields in _save_initial only for Django 1.10+
2016-11-18 23:31:45 +00:00
romgar
2455c983fc
Restore initial indentation
2016-11-18 23:12:39 +00:00
romgar
72158f1820
Avoid to directly initialise a monitored field if defered to avoid recursion issue
2016-11-18 23:11:23 +00:00
jarekwg
7a33e14f4b
Get StatusFields working
2015-10-29 00:02:46 +11:00
Sergey Zherevchuk
608028aba8
Fix #169 issue
...
Hardcoding no_excerpt_field field in deconstruct() method of SplitField class
2015-06-18 11:11:28 +03:00
ad-m
50caabdd2e
Fix #156 issue
2014-10-29 00:27:10 +01:00
Carl Meyer
9786672361
Remove dead code branch.
2014-09-22 12:49:35 -06:00
Keryn Knight
e353a01a9a
Implemented ability to change modified fields manually.
2014-07-01 14:38:58 +01:00
Rodney Folz
2905d1a307
Fix bug where you could only run makemigrations once without error.
2014-04-25 14:17:42 -07:00
Rodney Folz
85a9f8e6b1
Fix "model '%s' must have a %s choices class attribute" error on migrations.
2014-04-25 13:32:49 -07:00
Rodney Folz
db5e1f99fc
Fix "MonitorField requires a "monitor" argument"
2014-04-23 19:55:39 -07:00
Alejandro Varas
452ac5cd21
Added choices_name parameter to StatusField
2013-11-14 16:12:31 -03:00
Filipe Ximenes
3d82ec89b4
only accepting iterables to the when field
2013-10-11 08:24:00 -03:00