Skip to content

Guess type to add to arrayfield #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion django_seed/guessers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down