diff options
-rw-r--r-- | docs/reference.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/reference.rst b/docs/reference.rst index 4c7f8f7..3a57c66 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -534,6 +534,23 @@ Faker ... UserFactory() <User: Johannes Brahms> + .. classmethod:: add_provider(cls, locale=None) + + Some projects may need to fake fields beyond those provided by ``fake-factory``; + in such cases, use :meth:`factory.Faker.add_provider` to declare additional providers + for those fields: + + .. code-block:: python + + factory.Faker.add_provider(SmileyProvider) + + class FaceFactory(factory.Factory): + class Meta: + model = Face + + smiley = factory.Faker('smiley') + + LazyAttribute """"""""""""" |