klen / klen/mixer

Many2Many field - Django - mixer.SELECT not working

Open
#61 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
953
Forks
91
PR merge metrics
No merged PRs in 30d

Description

I saw this in documentation and tried to implement the same. `mixer.RANDOM` is working fine with m2m field. I will write a failing test case for the same.

```
# Generate SomeModel from SomeApp and select FK or M2M values from db
some = mixer.blend('someapp.somemodel', somerelation=mixer.SELECT)
```

Error.....
`ValueError: Mixer (projects.Project): "" needs to have a value for field "project" before this many-to-many relationship can be used.`
##

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/36508333-many2many-field-django-mixer-select-not-working?utm_campaign=plugin&utm_content=tracker%2F327725&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F327725&utm_medium=issues&utm_source=github).

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no repository files or existing test. Start by reproducing the Django example with a many-to-many field and mixer.SELECT, then add the failing test described in the report; done means the test passes without the ValueError while mixer.RANDOM continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
database, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.