summaryrefslogtreecommitdiff
path: root/factory/base.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polyconseil.fr>2011-12-12 16:24:26 +0100
committerRaphaël Barrois <raphael.barrois@polyconseil.fr>2011-12-12 16:24:26 +0100
commitd90d41a06e763067d80b5fdaf890d9b829c959c5 (patch)
tree0053ebc754d89f2c40768406cd48a26fa2458295 /factory/base.py
parent41c68349cf3925818a6c05477790a2f67d431d39 (diff)
downloadfactory-boy-d90d41a06e763067d80b5fdaf890d9b829c959c5.tar
factory-boy-d90d41a06e763067d80b5fdaf890d9b829c959c5.tar.gz
Django models always have a _default_manager attribute; .objects may not be a manager.
Diffstat (limited to 'factory/base.py')
-rw-r--r--factory/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/factory/base.py b/factory/base.py
index 890a7c9..f25fd5c 100644
--- a/factory/base.py
+++ b/factory/base.py
@@ -268,6 +268,6 @@ class DjangoModelFactory(Factory):
@classmethod
def _setup_next_sequence(cls):
try:
- return cls._associated_class.objects.values_list('id', flat=True).order_by('-id')[0] + 1
+ return cls._associated_class._default_manager.values_list('id', flat=True).order_by('-id')[0] + 1
except IndexError:
return 1