mixer
mixer copied to clipboard
Generate model instance with related data at once.
Thanks for the great library.
Is there an api to generate a model instance with several relations (OneToOne, ManyToOne, ManyToMany)? Like so:
user = mixer.blend(User)
.with(Profile, 1) # one profile
.with(Post, 4) # 4 posts
.with(Comment, 20, post=mixer.mix.posts) # 20 comments to previous posts