klen / mixer

Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.
Other
939 stars 96 forks source link

Many2Many field - Django - mixer.SELECT not working #61

Open geekashu opened 8 years ago

geekashu commented 8 years ago

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): "<Project: Mr. Kamron Kemmer>" 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).