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
f7f7cc0953
Fix repr tests for Python 2 (no string comparison)
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
81c7e40e60
Fix iterator/list problems for Python 3 support
2013-04-12 14:16:42 -07:00
Carl Meyer
4ee0c39db3
Add tests for StatusField no_check_for_status.
2013-04-10 12:52:53 -06:00
Trey Hunner
59e484e17f
Fix StatusField bug
...
Fixes #29
2013-04-09 14:28:53 -07:00
Trey Hunner
2769e79796
Fix BooleanField default (for Django trunk)
2013-03-27 22:43:21 -07:00
Trey Hunner
4156fa40e9
Add test for ModelTracker before first model save
2013-03-27 16:59:42 -07:00
Trey Hunner
cddcbd4e42
ModelTracker: pass kwargs to parent save correctly
...
Fixes usage of update_fields in save()
2013-03-27 16:59:42 -07:00
Trey Hunner
98016dbd50
ModelTracker: check DB after using update_fields
2013-03-27 16:59:42 -07:00
Trey Hunner
d24dbc6c38
Fix ModelTracker for obj.save(update_fields=[...])
2013-03-27 16:59:42 -07:00
Trey Hunner
d9c415c5cd
Add ModelTracker test for save(update_fields=[...])
2013-03-27 16:59:42 -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
Trey Hunner
cf153f3c06
Add test for ModelTracker descriptor on class
2013-02-18 20:13:39 -08:00
Trey Hunner
335500018a
Make `from model_utils import ModelTracker` work
2013-02-18 20:09:08 -08:00
Trey Hunner
b1979a52b3
Add tests for multiple model trackers
2013-02-18 20:06:52 -08:00
Trey Hunner
7ac6e8a81c
Add tests for ModelTracker.current method
2013-02-18 17:33:26 -08:00
Trey Hunner
45ac3bd03f
Fix return value of ModelTracker.current pre-save
2013-02-18 17:32:30 -08:00
Trey Hunner
1ae2effc22
Merge ModelTracker and descriptor classes
2013-02-18 16:36:05 -08:00
Trey Hunner
a68649c9e7
Rename current_fields to current
2013-02-18 16:26:54 -08:00
Trey Hunner
f4512642cb
Remove unnecessary use of setattr
2013-02-18 16:22:11 -08:00
Trey Hunner
676424e388
Move ModelTracker to tracker module
2013-02-18 16:21:14 -08:00
Trey Hunner
c528a347e0
Add ModelTracker with tests
2013-02-16 14:52:31 -08:00
Carl Meyer
579abf8e66
Fix calling create() on a related manager based on PassThroughManager.
2013-02-12 14:05:31 -07:00
Carl Meyer
cf2c97b620
Avoid overriding prior calls to select_related in select_subclasses.
2013-02-01 22:53:11 -07:00
Carl Meyer
93a1a44ee7
Updates to multi-level support for InheritanceManager.
2013-02-01 22:38:14 -07:00
Ivan Virabyan
937b3e018f
Support for multi-level inheritance in InheritanceManager
2013-01-31 18:27:16 +04:00
Carl Meyer
246fb81813
Revert addition of UpdateOrCreateMixin; reaches 100% test coverage.
2013-01-27 14:16:58 -08:00
Carl Meyer
983fab0341
Clean up some uses of hasattr; no need to support 1.1 any longer.
2013-01-27 13:41:03 -08:00
Carl Meyer
6ae66e0153
Removed a bunch of deprecated code.
2013-01-27 13:30:31 -08:00
Carl Meyer
a9ac3685fb
Removed deprecated ChoiceEnum; moved Choices out of __init__.py.
2013-01-27 13:19:45 -08:00
Carl Meyer
f7f54a03b0
Enable pickling PassThroughManager in Django 1.5.
2013-01-26 22:10:14 -08:00
Carl Meyer
a76006a3b2
Merge UpdateOrCreateMixin.
2013-01-26 17:20:52 -08:00
Carl Meyer
05f1dc97b3
Set use_for_related_fields=True on QueryManager.
2013-01-26 17:09:16 -08:00
Carl Meyer
ec1870c98a
Merge pull request #19 from DXist/master
...
Extra deny methods for PassThroughManager
2013-01-26 17:05:15 -08:00
Carl Meyer
41607c0b56
Resolve duplication between two pull requests for Choices.__len__.
2013-01-26 17:04:15 -08:00
Carl Meyer
4217dbd7fe
Merge pull request #16 from ryankask/choices-len
...
__len__ method for Choices
2013-01-26 17:01:06 -08:00
Carl Meyer
aa8c79eeb4
More straightforward, efficient implementation for InheritanceQuerySet.
2013-01-26 16:46:51 -08:00
Carl Meyer
8808aa05b8
Merged in jgsogo/django-model-utils (pull request #5 )
...
patch to issue #16
2013-01-26 16:40:26 -08:00
Rinat Shigapov
e9e57e096f
deny methods for queryset copy
2012-11-08 12:24:17 +04:00
Javier García Sogo
575a5e1340
avoid plain except
2012-11-05 13:43:42 +01:00
James Oakley
9ea6605226
Add __len__() method to Choices
2012-10-30 11:01:57 -07:00
Carl Meyer
2376c931ab
Update PassThroughManager docstring to match README docs; thanks atreanor.
2012-09-27 09:48:04 -06:00
Antti Kaihola
21371e3ea4
Added missing imports for UpdateOrCreateMixin
2012-08-27 15:21:52 +03:00
Javier Garcia Sogo
6ab6da083c
patch to issue#16
2012-07-06 22:12:58 +02:00
Antti Kaihola
c83c14c46f
Added an UpdateOrCreateMixin for creating custom managers and querysets which have an .update_or_create() method (see Django ticket #3182 ).
2012-06-08 16:47:28 +03:00
Ryan Kaskel
7cbfbdb453
len support for Choices.
2012-05-10 12:07:42 +01:00
Donald Stufft
31e5fb3c4a
updated to use the new 1.4 timezones
2012-01-07 17:43:39 -05:00
Carl Meyer
4746180c4d
Improved fix for annotations and InheritanceQuerySet. Thanks Facundo Gaich.
2012-01-03 16:47:33 -07:00
Carl Meyer
c35746a445
Fixed annotation of InheritanceQuerySets. Thanks Jeff Elmore.
2012-01-03 15:47:41 -07:00
Carl Meyer
5710c8b504
Dropped support for obsolete Python 2.5 and Django 1.1.
2012-01-03 15:40:17 -07:00
Carl Meyer
8c6af71713
Updated PassThroughManager.for_queryset_class for less ambiguous behavior in case of incorrect usage.
2011-12-05 17:08:51 -07:00
Ryan Kaskel
6afa9d566d
Add convenience method to PassThroughManager.
2011-12-04 13:57:16 +00:00
Carl Meyer
b2aa8c2692
Merged.
2011-10-26 11:12:42 -06:00
smacker
b06ba20fe9
test and docs for get_subclass
2011-10-26 23:06:55 +06:00
smacker
9ac5877d29
add get_subclass method
2011-10-26 12:01:37 +06:00
Jeff Elmore
37e4eecace
Added explicit test of using 'get' method with select_subclasses
...
--HG--
extra : transplant_source : %9F%EA%C6%81%1D%BE%AA%0BQ5%A7%ECs%0Dwb%B8%B15%60
2011-07-02 11:58:14 -04: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
5c5abdce23
Added use_for_related_fields=True to InheritanceManager. Fixes #8 . Thanks munhitsu for the report.
...
Note that the tests added for this feature pass even without the change to
InheritanceManager, because use_for_related_fields is broken in Django and
always acts as if True for reverse FKs and M2Ms.
(http://code.djangoproject.com/ticket/14891 )
2011-04-16 16:19:55 -05:00
Carl Meyer
69d0985db1
Started deprecation for manager_from, InheritanceCastModel, and Django 1.1 support.
2011-04-16 14:51:14 -05:00
Carl Meyer
c514c68676
Updated test-runner.
2011-04-16 14:49:33 -05:00
Carl Meyer
7c19b761e2
Merged in fix for Django 1.1 recursion error from Paul McLanahan.
2011-03-30 10:20:37 -04:00
Paul McLanahan
d8798fb784
Fixed a recursion error in Django 1.1
2011-03-29 21:57:49 -04:00
Carl Meyer
36b99304c2
Merged in PassThroughManager from Paul McLanahan.
2011-03-29 13:10:50 -04:00
Carl Meyer
e418cc909a
Fixed issue #6 , bug with InheritanceManager and descriptor fields (e.g. FileField).
...
Thanks zyegfryed for the fix and sayane for tests.
2011-03-29 12:47:25 -04:00
Carl Meyer
1a8f7c5087
Added tox config.
2011-03-29 12:41:22 -04:00
zyegfryed
ae64c23b39
Fixed related subclasses parsing. Was raising AttributeError on FileField.
2011-03-29 14:59:50 +02:00
Paul McLanahan
04c848e8c7
Added tests for PassThroughManager.
2011-03-09 14:44:10 -05:00
Paul McLanahan
c624d7a301
Added PassThroughManager to managers.
...
Added me to authors.
2011-03-08 13:52:32 -05:00
Carl Meyer
552f7c2009
Fixed #2 - Updated SplitField for 1.2-style prep_value method.
2011-02-18 16:45:39 -05:00
Carl Meyer
ac36cbf56c
Added InheritanceManager, contributed by Jeff Elmore.
2010-11-23 12:48:23 -05:00
Carl Meyer
396dd9274f
use manager_from for inheritance-casting
2010-10-05 09:01:26 -04:00
Carl Meyer
a2c67934ed
additional test, docs cleanup
2010-10-05 08:59:25 -04:00
Gregor Müllegger
216db6c098
Creating a custom QuerySet subclass for InheritanceCastModel to provide a way to batch cast a queryset of parents into child types. It's (2 + m) queries instead of (1 + n * 2) now (n: number of returned objects, m: number of different types in the queryset).
2010-10-01 20:43:22 +02:00
Carl Meyer
1d4613e807
make tests compatible with pre-1.2
2010-09-24 10:30:58 -04:00
Carl Meyer
5da38ee0c6
manager_from bugfix from George Sakkis; fixes #1
2010-08-16 17:58:16 -04:00
Carl Meyer
afafdd2bf9
make manager_from Django 1.1 compatible
2010-07-30 22:45:45 -04:00
Carl Meyer
cfd6578fe5
improve test coverage
2010-07-30 22:36:24 -04:00
Carl Meyer
aed583f763
added manager_from (thanks George Sakkis)
2010-07-30 22:09:46 -04:00
Carl Meyer
726f0de1dd
minor cleanup
2010-04-27 13:25:45 -04:00
Carl Meyer
be0f667204
fix typos in test names
2010-04-27 13:19:08 -04:00
Jannis Leidel
911b5223c8
Fixed bug which prevented the StatusModel and TimeframedModel to get the appropriate QueryManager instances added dynamically before instantiation.
2010-04-26 22:30:01 +02:00
Jannis Leidel
8e2893f1b7
Fixed typo.
2010-04-23 12:47:38 +02:00
Jannis Leidel
e4564f73db
Automated merge with http://bitbucket.org/carljm/django-model-utils/
2010-04-23 12:45:15 +02:00
Jannis Leidel
43138fbaaa
Extended South introspection rules to handle StatusField and MonitorField.
2010-04-23 12:44:59 +02:00
Carl Meyer
d4951f6651
added triple option in Choices to split db representation from code constant
2010-04-22 13:02:25 -04:00
Carl Meyer
238571ed43
docs, AUTHORS, Changelog...
2010-04-16 00:37:12 -04:00
Carl Meyer
f64f16b053
Choices should be indexable as if it were a two-tuple
2010-04-16 00:11:31 -04:00
Carl Meyer
acbf46abb2
remove duplication between StatusModel tests
2010-04-15 23:59:05 -04:00
Carl Meyer
3e78add2d5
split out TimeFramedModel tests
2010-04-15 23:55:24 -04:00
Carl Meyer
d95f9efcf1
consistent PEP8 test method names
2010-04-15 23:52:31 -04: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
Carl Meyer
fecda79f5c
deprecate ChoiceEnum and document Choices
2010-04-15 22:54:37 -04:00
Carl Meyer
02b2082e90
Fix Choices docstring, minor code changes:
...
- remove __getitem__, no need for it anymore
- remove implicit lowercasing (principle of least surprise: strings are usually case sensitive)
2010-04-15 22:32:33 -04:00
Carl Meyer
cb46293b0a
merge backout
2010-04-15 22:30:03 -04:00
Carl Meyer
8efaf852c8
Backed out changeset c05246980ddf
2010-04-15 22:16:10 -04:00
Carl Meyer
49760e3559
merge backout
2010-04-15 22:15:54 -04:00
Carl Meyer
c236944568
Backed out changeset 4e9eb14b9047
2010-04-15 22:15:39 -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
ff44c8de10
Moved the setting of the dynamic QueryManager to model classes. Removed metaclasses.
2010-04-16 00:01:38 +02:00
Jannis Leidel
cac35036d3
Fixed terrible typo.
2010-04-15 23:59:31 +02:00
Jannis Leidel
f04c200c09
Made the testrunner Django 1.2 compatible.
2010-04-15 23:56:56 +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
73b211309d
Marked a few labels for translation.
2010-04-15 04:49:51 +02:00
Jannis Leidel
7716c6397e
Minor cleanups.
2010-04-15 04:43:27 +02:00
Jannis Leidel
1fce7073e2
Added get_<choice>_display function to ChoiceNum to easily display human readable option label.
2010-04-15 04:36:21 +02:00
Jannis Leidel
50919b9ff4
Added ability to optionally use a label on ChoiceEnums choices. Useful for translation.
2010-04-10 00:50:35 +02:00
Carl Meyer
9147becfc9
made SplitField compatible with South FakeORM
2010-01-31 10:54:36 -05:00
Carl Meyer
dfd804bba2
added has_more property to SplitField
2010-01-27 23:37:31 -05:00
Carl Meyer
85157347f1
added SplitField
2010-01-15 17:26:59 -05:00
Carl Meyer
a2dcac06de
added ChoiceEnum
2010-01-12 21:47:28 -05:00
Carl Meyer
0e6de5ae75
support South for custom fields
2010-01-06 23:20:31 -05:00
Carl Meyer
ee3881a1ff
updated setup.py: removed include_package_data, added test_suite
2009-10-26 17:49:44 -04:00
Carl Meyer
7703512c7f
0.3.0
...
--HG--
extra : convert_revision : carl%40dirtcircle.com-20090730211136-ywu7dfqfmsodkc1x
2009-07-30 17:11:36 -04:00
Carl Meyer
2d018ca847
added TimeStampedModel
...
--HG--
extra : convert_revision : carl%40dirtcircle.com-20090702201429-hph32omqgfgrga52
2009-07-02 16:14:29 -04:00
Carl Meyer
3247ac5d4b
initial import (with InheritanceCastModel)
...
--HG--
extra : convert_revision : carl%40dirtcircle.com-20090702180302-idhig8pzmbv8nv7l
2009-07-02 14:03:02 -04:00