Commit graph

55 commits

Author SHA1 Message Date
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
Carl Meyer
552f7c2009 Fixed #2 - Updated SplitField for 1.2-style prep_value method. 2011-02-18 16:45:39 -05:00
Jannis Leidel
8e2893f1b7 Fixed typo. 2010-04-23 12:47:38 +02:00
Jannis Leidel
43138fbaaa Extended South introspection rules to handle StatusField and MonitorField. 2010-04-23 12:44:59 +02:00
Carl Meyer
545bccf3ce convert StatusModifiedField to generic MonitorField, use post_init signal instead of extra DB query 2010-04-15 23:47:28 -04:00
Carl Meyer
c43b1ba99d remove previous_status from StatusField public API
I may be missing the use case, but this seems too ephemeral to be
useful (only exists on same instance after a save, can't rely on it
being there in general). If it's just an implementation detail for
StatusModifiedField, it doesn't need to be tested in public API for
StatusField.
2010-04-15 23:07:12 -04:00
Jannis Leidel
2c8d042cf3 Removed the need for the status choices to be a subclass of model_utils.Choices. 2010-04-16 00:12:08 +02:00
Jannis Leidel
cac35036d3 Fixed terrible typo. 2010-04-15 23:59:31 +02:00
Jannis Leidel
ee4f42f851 Added new `Choices class as a replacement for ChoiceEnum`. Also renamed Condition* et al to Status*. 2010-04-15 20:00:44 +02:00
Jannis Leidel
35d25f0a0f Added TimeFramedModel and ConditionalModel. 2010-04-15 04:53:55 +02:00
Jannis Leidel
7716c6397e Minor cleanups. 2010-04-15 04:43:27 +02:00