Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows _quantity use on recipes containing OneToOne fields (#145) #169

Merged
merged 4 commits into from
Apr 1, 2021

Conversation

Honza-m
Copy link
Contributor

@Honza-m Honza-m commented Mar 31, 2021

Fixes #145 by adding an one_to_one argument to foreign_key and documents the behaviour.

When one_to_one=True, the make_recipe function will create an unique related model for each _quantity. This is False by default so the behaviour where only one related model is created remains the default.

Thanks for all the 🍰 😄

Copy link
Member

@berinhard berinhard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @Honza-m! I really liked the strategy you've implemented on adding a new boolean parameter to the foreign_key method. Nice touch with the docs too. Thanks for your contribution!

@berinhard berinhard merged commit ffaccc3 into model-bakers:main Apr 1, 2021
@tuky
Copy link
Contributor

tuky commented Jul 22, 2021

Thank you all 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OneToOneField breaks _quantity > 1
3 participants