Commit graph

65 commits

Author SHA1 Message Date
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
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
Filipe Ximenes
e3450977bd adding 'when' parameter to MonitorField 2013-10-11 00:08:38 -03:00
Carl Meyer
216d0b7095 Fix GH-41: re-add get_FOO_display method to models with StatusField. 2013-05-02 11:33:48 -06:00
Trey Hunner
32bb718107 Remove reduntant "as" in import 2013-04-12 17:13:35 -07:00
Trey Hunner
e6293d9b0c Remove datetime imports unused by Django 1.4+ 2013-04-12 17:13:31 -07:00
Trey Hunner
4f2673e6a4 Fix str/unicode problems in Python 3
Changes:
- Use unicode_literals from the future for Python 2.6.5+
- Use six's text_type for proper unicode use in Python 2/3
2013-04-12 14:16:42 -07:00
Trey Hunner
59e484e17f Fix StatusField bug
Fixes #29
2013-04-09 14:28:53 -07:00
Carl Meyer
147fdf5d89 Remove silly uses of setattr. 2013-02-21 16:31:29 -07:00
Felipe Prenholato
cce804da4e Assert that StatusField respects default arguments. 2013-02-21 17:08:15 -03:00
Carl Meyer
6ae66e0153 Removed a bunch of deprecated code. 2013-01-27 13:30:31 -08:00
Donald Stufft
31e5fb3c4a updated to use the new 1.4 timezones 2012-01-07 17:43:39 -05:00
Carl Meyer
b7c5a59390 Fixed using SplitField on an abstract base model class. 2011-04-28 20:59:52 -05:00
Carl Meyer
ab70211d29 Removed unneeded creation_counter increment. 2011-04-28 19:59:46 -05:00