Skip to content

Commit

Permalink
Updates docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mazulo committed Nov 3, 2022
1 parent c6e5655 commit b29357d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/source/how_bakery_behaves.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,29 @@ Additionaly, if you want to your created instance to be returned respecting one
movie = baker.make(Movie, title='Old Boys', _from_manager='availables') # This will use the Movie.availables model manager
Also passing ``_use_faker_generator=True`` will make ``baker`` to use `Faker <https://pypi.org/project/Faker/>`_ to generate values. ``baker`` will read the field name and then select a generator from there. Currently we only support the following fields, however this list will increase:

- ``username``
- ``email``
- ``first_name``
- ``last_name``
- ``name``
- ``fullname``
- ``full_name``
- ``ip``
- ``ipv4``
- ``ipv6``

Examples:

.. code-block:: python
profile = baker.make(
models.Profile,
_use_faker_generator=True,
)
print(profile.name) # would print a more realistic fake email, for example: 'Erik Barnett'
Save method custom parameters
-----------------------------

Expand Down

0 comments on commit b29357d

Please sign in to comment.