From 27deaa28d0dcf91efbb05523abf6e0a1f24098c0 Mon Sep 17 00:00:00 2001 From: Tobin Brown Date: Tue, 4 Feb 2020 17:04:51 -0600 Subject: [PATCH] Fix user-specified locale not being used (#67) * Initialise faker with specified locale * add locale to readme * bump Co-authored-by: Viren Nadkarni --- README.rst | 7 +++++++ django_seed/__init__.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index cec4196..8311a40 100644 --- a/README.rst +++ b/README.rst @@ -105,6 +105,13 @@ Django-seed does not populate auto-incremented primary keys, instead ``seeder.ex : [1, 2, 3, 4, 5] } +You may specify a different locale by passing it in the constructor of the seeder. Defaults to `settings.LANGUAGE_CODE` + +.. code-block:: python + + seeder = Seed.seeder(locale='sv_SE') + seeder.faker.city() # 'Västerås' + ----- Tests diff --git a/django_seed/__init__.py b/django_seed/__init__.py index ee32ce5..29539fd 100644 --- a/django_seed/__init__.py +++ b/django_seed/__init__.py @@ -2,7 +2,7 @@ import random -__version__ = '0.2.1' +__version__ = '0.2.2' class Seed(object):