summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polyconseil.fr>2011-08-18 11:27:31 +0200
committerRaphaël Barrois <raphael.barrois@polyconseil.fr>2011-08-18 11:27:31 +0200
commit0064fcff0df2c04c48e3e70723a2f523d30fb533 (patch)
treebe82b5517135dc4cd71417bc004e67782a9479bc
parente7ff751f670df86450a7e09d1c6b542c32448ef4 (diff)
downloadfactory-boy-0064fcff0df2c04c48e3e70723a2f523d30fb533.tar
factory-boy-0064fcff0df2c04c48e3e70723a2f523d30fb533.tar.gz
Cleanup rmoch's DjangoModelFactory fix.
Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr>
-rw-r--r--factory/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/factory/base.py b/factory/base.py
index f33657f..b17938e 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][0] + 1
+ return cls._associated_class.objects.values_list('id', flat=True).order_by('-id')[0] + 1
except IndexError:
return 1