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.
Methods that are useful for generating random data directly, that are not wrapped by :mod:`anonymizer.replacers`:
Methods useful for 3rd parties to generate random data that respects Django models:
Methods with useful/interesting 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.
DjangoFaker has various other methods, most of which delegate to an underlying faker.Faker instance, including 'street_address', 'city' etc. See the source for more details.