From bddce342691eecec1f1fb39718e16e8ec6f55197 Mon Sep 17 00:00:00 2001 From: Forest Anderson Date: Sat, 5 Jun 2021 11:38:03 -0400 Subject: [PATCH] Guess type to add to arrayfield --- django_seed/guessers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django_seed/guessers.py b/django_seed/guessers.py index 3c497f5..f3a270a 100644 --- a/django_seed/guessers.py +++ b/django_seed/guessers.py @@ -120,7 +120,8 @@ def guess_format(self, field): return lambda x: _timezone_format(faker.date_time()) if isinstance(field, DateField): return lambda x: faker.date() if isinstance(field, TimeField): return lambda x: faker.time() - if isinstance(field, ArrayField): return lambda x: [faker.text()] + if isinstance(field, ArrayField): + return lambda x: [self.guess_format(field.base_field)(1)] # TODO: This should be fine, but I can't find any models that I can use # in a simple test case.