Closed sobolevn closed 4 years ago
You can use the pre_save
hook to call any logic you want right before the changes are committed to the database. This includes setting fields on the instance:
fakery.m(
User,
pre_save=[
lambda i: i.email = '{0}@example.com'.format(i.username)
],
)(username='test')
Awesome! Thanks.
Hi! Thanks a lot for building this project.
I try to solve this problem:
But I am not sure that I am able to with
django-fakery
currently.