Commit graph

238 commits

Author SHA1 Message Date
Carl Meyer
3f9b1cfac8 Fix select_subclasses for Django 1.8. 2015-01-27 16:48:06 -07:00
Carl Meyer
3110794afc Fix 'add_*_manager' signal handlers for Django 1.8+. 2015-01-27 16:43:29 -07: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
bboogaard
041ef6b838 Keep track of deferred fields on model instance
Instead of on FieldInstanceTracker instance

Signed-off-by: bboogaard <b.boogaard@auto-interactive.nl>
2014-08-19 10:29:03 +02:00
Carl Meyer
54d915bd4a Bump version to 2.3a1. 2014-07-31 18:57:29 -06:00
Carl Meyer
c62fe9446d Add Changelog entry for revert of GH-130; bump version to 2.2. 2014-07-31 18:16:15 -06:00
Carl Meyer
a127e32217 Revert "Use a signal handler instead of patching save."
This reverts commit 3496fe4291.
2014-07-31 18:08:24 -06:00
Carl Meyer
a0ba93f8c2 Bump version to 2.2a1. 2014-07-25 10:00:46 -06:00
Carl Meyer
24fa8945bb Bump version to 2.1.0. 2014-07-25 09:52:55 -06:00
Matthew Schinckel
3496fe4291 Use a signal handler instead of patching save.
References #83.

Instead of patching the save method of a tracked model class, we can use
a signal handler on post_save, which means we can still pickle our model
class.

Note we can't just listen for the signal from the class we have, but
instead listen for all post_save signals. This means we actually install
a new signal handler for each tracked model class, which fires on all
model save occurrences (and returns immediately if this handler doesn't care).

We probably could improve this to have a registry of tracked models, or
something, that allows us to just install one signal handler, and filter
according to membership.
2014-05-12 14:32:59 +09:30
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
Rodney Folz
f02b0912b2 Failing test for Django 1.7 makemigrations
======================================================================
ERROR: test_migrate (model_utils.tests.tests.MigrationsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/projects/django-model-utils/model_utils/tests/tests.py", line 42, in test_migrate
    call_command('migrate', fake=True)
  File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 167, in call_command
    return klass.execute(*args, **defaults)
  File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/core/management/base.py", line 337, in execute
    output = self.handle(*args, **options)
  File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 138, in handle
    ProjectState.from_apps(apps),
  File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/db/migrations/state.py", line 71, in from_apps
    model_state = ModelState.from_model(model)
  File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/db/migrations/state.py", line 136, in from_model
    e,
TypeError: Couldn't reconstruct field name_changed on tests.Monitored: MonitorField requires a "monitor" argument
2014-04-23 19:10:04 -07:00
Keryn Knight
8a1d0662f1 Provide dir() support for PassThroughManagers.
Reported in #55 by erikcw.
2014-04-15 08:48:01 +01:00
Carl Meyer
61923571b9 Bump version to 2.0.3.post1 for dev. 2014-03-19 22:48:13 -06:00
Carl Meyer
36b7e600c6 Bump version to 2.0.3 for release. 2014-03-19 22:43:48 -06:00
Matthew Schinckel
93500bb381 Ensure we call get_query_set on django 1.5-
Supersedes https://github.com/carljm/django-model-utils/pull/106

I can't actually see why this works, but it does: tests pass
after this that failed before.
2014-03-20 13:11:00 +10:30
Matthew Schinckel
a49936c267 Test case demonstrating relation failure.
https://github.com/carljm/django-model-utils/issues/120
2014-03-20 11:12:38 +10:30
Seán Hayes
3f7378ef60 Allow PassThroughManager subclasses to accept additional params. 2014-03-07 06:32:34 -05:00
Michael van Tellingen
2bcddd5be9 Add fix for Django 1.4 2014-03-01 14:24:25 +01:00
Michael van Tellingen
6ffae1ad8f Add support for deferred fields in the FieldTracker 2014-03-01 13:34:17 +01:00
Michael van Tellingen
1bab9c492d Add failing test 2014-03-01 12:20:13 +01:00
Carl Meyer
f26b33acbc Merge pull request #114 from rsenkbeil/inheritance-manager-self-reference
Fix InheritanceManager when the model has a self reference.
2014-02-19 15:41:01 -07:00
Ryan Senkbeil
617ec2af01 Fix InheritanceManager when the model has a self reference.
Otherwise, we reach max recursion depth.
2014-02-19 15:28:01 -06:00
Carl Meyer
fe0eceaa74 Bump version to 2.0.2.post1. 2014-02-19 14:01:51 -07:00
Carl Meyer
923f131084 Bump version to 2.0.2. 2014-02-19 13:59:49 -07:00
Carl Meyer
6579f5d61f Bump version to 2.0.1.post1. 2014-02-11 15:03:08 -07:00
Carl Meyer
d77608ef76 Bump version to 2.0.1. 2014-02-11 14:58:18 -07:00
Carl Meyer
f19755ae81 Merge pull request #105 from patrys/patch-1
Don't try to access __slots__ during copy()
2014-01-25 16:35:09 -08:00
Carl Meyer
febc3d645a Merge pull request #101 from funkybob/issue-34
Attempt to carry over extras(select) values from parent
2014-01-25 16:25:36 -08:00
Carl Meyer
26f4d7c8f5 Silence BooleanField default warnings. 2014-01-25 17:11:26 -07:00
funkybob
a5fe3de330 Deal with Django <1.7 using SortedDict wherein keys() is a generator, not a view 2014-01-21 09:19:54 +11:00
Patryk Zawadzki
80547335c0 Don't try to access __slots__ during copy()
When subclassing Django will copy managers from the ancestor class. Copying in turn calls `copy.copy()` which checks whether the object uses `__slots__` or `__dict__`. This could result in the manager calling `self.get_queryset()` before all models get registered with the ORM.
2014-01-20 12:50:37 +01:00
funkybob
91b07079e0 Use legacy compatible approach 2014-01-14 15:05:03 +11:00
funkybob
cb362f4a12 Shorten test docstring 2014-01-13 16:49:18 +11:00
Carl Meyer
6512e3e00e Remove trailing whitespace. 2014-01-10 16:29:59 -07:00
Douglas Meehan
33c600e28c edited class names 2014-01-10 16:18:10 -05:00
Douglas Meehan
9e024a14af removed trailing whitespace 2014-01-10 16:15:42 -05:00
Douglas Meehan
aaf1fc8636 changed class names to be more descriptive 2014-01-10 16:06:08 -05:00
Douglas Meehan
55a15f7e55 Update managers.py 2014-01-09 16:58:51 -05:00
Douglas Meehan
72c8f0bc18 moved get_query_set = get_queryset from the mixin to the manager 2014-01-09 21:47:46 +00:00
Curtis Maloney
0e77c327f5 Update tests.py 2014-01-09 15:46:11 +11:00
Douglas Meehan
c787a98f21 removed GeoDjango specific code. Abstracted all managers 2014-01-08 17:19:00 +00:00
Douglas Meehan
e7c3f6b28e edited doc string 2014-01-08 16:57:59 +00:00
Douglas Meehan
a1ffac9fa7 edited class names 2014-01-08 16:56:32 +00:00
Douglas Meehan
a1abc9bb8a edited class names 2014-01-08 16:54:41 +00:00
Douglas Meehan
b529e576ff added geo support for PassThroughManager 2014-01-08 16:46:39 +00:00
Curtis
6f30e88ba5 Attempt to carry over extras(select) values from parent 2014-01-08 23:46:00 +11:00