django-anonymizer / docs / djangofaker.rst

DjangoFaker - Django-aware fake data

This class is used by the :mod:`anonymizer.replacers` module to generate fake data. It encapsulates some knowledge about Django models and fields to attempt to generate data that fits the constraints of the model.

The remaining public methods all generate different types of fake data, using get_allowed_value to apply constraints. Many methods use an underlying faker.Faker instance. These include the following, which have some useful properties.

These name-related methods have the property that the same underlying first name and last name will be used until you repeat any of the methods. This means that if you use these methods to generate a set of data for a user model, the name/username/email address for a single object will correspond to each other.

For models with unique constraints on one of these fields, there is the complication that django-anonymizer will avoid setting unique fields to already present or already generated values. Sometimes this means that a fake data source must be used more than once to get a unique value, and this can upset the state of the cycle. To avoid this, put fields with a unique constraint at the start of the :attr:`~anonymizer.base.Anonymizer.attributes` list.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.