mixer icon indicating copy to clipboard operation
mixer copied to clipboard

Skip Django related models generation when primary key is provided

Open DXist opened this issue 10 years ago • 0 comments

It would be nice to skip generation of related Django model when related key is provided. Example:

class Author(models.Model):
    ... 

class Book(models.Model):
      author = models.ForeignKey(Author)
       ...
# don't generate extra author instance
mixer.blend(Book, author_id=3)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/6290149-skip-django-related-models-generation-when-primary-key-is-provided?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).

DXist avatar Nov 19 '14 11:11 DXist