diff options
Diffstat (limited to 'factory')
-rw-r--r-- | factory/__init__.py | 1 | ||||
-rw-r--r-- | factory/base.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/factory/__init__.py b/factory/__init__.py index 9a1513d..4669e61 100644 --- a/factory/__init__.py +++ b/factory/__init__.py @@ -24,6 +24,7 @@ __author__ = 'Mark Sandstrom <mark@deliciouslynerdy.com>' from base import ( Factory, StubFactory, + DjangoModelFactory, BUILD_STRATEGY, CREATE_STRATEGY, STUB_STRATEGY diff --git a/factory/base.py b/factory/base.py index 61bf07e..f33657f 100644 --- a/factory/base.py +++ b/factory/base.py @@ -264,6 +264,6 @@ class DjangoModelFactory(Factory): @classmethod def _setup_next_sequence(cls): try: - return cls._associated_class.objects.values_list('id').order_by('-id')[0] + 1 + return cls._associated_class.objects.values_list('id').order_by('-id')[0][0] + 1 except IndexError: return 1 |