-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Enable seq to be imported from baker #76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for a good proposal @radwon !
I am wondering if we should consider following the same pattern for other things that we often import, for example stuff from recipe
module - recipe.Recipe
, recipe.foreign_key
etc.
Then maybe we can think about better unifying the whole thing maybe, otherwise we'd have too many possibilities (which is not always a good practice):
from model_bakery import baker, recipe
baker.seq("test")
recipe.seq("test")
baker.Recipe("mymodel")
recipe.Recipe("mymodel")
Anyways, I'd love to hear other opinions here before going forward.
@radwon @anapaulagomes @berinhard what do you think?
I agree with your suggestion @amureki for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable the seq() function to be imported from the baker module like it is in the recipe module so that it can be used as baker.seq() if preferred or to avoid namespace issues. The current import can be left in place for backwards compatibility or to continue importing seq as before. Closes model-bakers#75
@berinhard I've made the requested changes, and also made some changes to Hope that's OK. Let me know if there's anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @radwon! It looks great =)
I'm merging since @anapaulagomes had already approved this previously and @radwon only added tests to make sure the changes he'd introduced are working. |
* origin/master: Enable seq to be imported from baker (#76)
Enable the seq() function to be imported from the baker module like
it is in the recipe module so that it can be used as baker.seq() if
preferred or to avoid namespace issues.
The current import can be left in place for backwards compatibility
or to continue importing seq as before.
Closes #75