Generate model instance with related data at once.
- Dominant language
- Python
- Stars
- 953
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Description
Thanks for the great library.
Is there an api to generate a model instance with several relations (OneToOne, ManyToOne, ManyToMany)? Like so:
```python
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
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing Mixer’s existing fixture-generation APIs and how they support Django, Flask, SQLAlchemy, and custom Python objects. Define the supported relation combinations and the chaining behavior requested in the example; done means related instances can be generated together with predictable counts and links across those integrations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100