From 15f328350311ee46f84c628310e58e4ed8b49e13 Mon Sep 17 00:00:00 2001 From: Raphaƫl Barrois Date: Tue, 20 Oct 2015 23:08:29 +0200 Subject: Docs: Document Faker.add_provider (Closes #218) --- docs/reference.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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() + .. 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 """"""""""""" -- cgit v1.2.3