berinhard / model_mommy

No longer maintained, please migrate to model_bakery
http://model-bakery.readthedocs.org/
Other
903 stars 141 forks source link

Write a recipe where ommitted fields are still populated automatically? #67

Closed grjones closed 11 years ago

grjones commented 11 years ago

I really only need to write a recipe to populate one field--not all of them. Is it possible to have the remaining fields auto-populate? If not, I'd be happy to add this functionality.

berinhard commented 11 years ago

Hi @grjones! I'm a +1 for this funcionality. I don't see a real need to recipes don't use model mommy creation under the hood.

vandersonmota commented 11 years ago

Well, recipes are intended to provide deterministic data generation, for cases where random data is not desired. BUT, i think another kind of recipe, with the functionality you described can be created. =) More thoughts on the subject?

vandersonmota commented 11 years ago

i think 'FastRecipe' its a good name. =)

henriquebastos commented 11 years ago

I'm +1 for this feature.

A completely deterministic data generation could be achieved by defining all generation rules on a Recipe. I don't see the need for a "FastRecipe" if we can add that flexibility to Recipe without ambiguity.

This seems feasible and relates to what we've been talking on simplifying Mommy's api.

vandersonmota commented 11 years ago

Hmm... guess you're right @henriquebastos

@grjones Just don't forget to change recipes docs after doing so. =)

grjones commented 11 years ago

Yeah, what @henriquebastos said. :)

@vandersonmota I will be sure to change the docs. Thanks.

berinhard commented 11 years ago

I'm with @henriquebastos and I think I can work on it tomorrow! Em 07/02/2013 18:58, "Gregory Jones" notifications@github.com escreveu:

Yeah, what @henriquebastos https://github.com/henriquebastos said. :)

@vandersonmota https://github.com/vandersonmota I will be sure to change the docs. Thanks.

— Reply to this email directly or view it on GitHubhttps://github.com/vandersonmota/model_mommy/issues/67#issuecomment-13262619.

grjones commented 11 years ago

So you're coding this @berinhard? Let me know if you'd like me to.

henriquebastos commented 11 years ago

If more than one dev wants to give this issue a try, I recommend that (1) you share here your approach to solve it and/or (2) start a PR with a POC, at least about the proposed API.

Please, don't feel blocked, since @vandersonmota will need to merge it, he can cherry-pick both PRs.

grjones commented 11 years ago

I would rather not do parallel work. Hope that is ok. Someone just let me know who is coding this. In case this sways the decision, I committed a small change a while back but this would really be my first significant commit.

henriquebastos commented 11 years ago

As you wish. It was just a suggestion. My personal approach is that if there isn't a PR, there is no code. :-P

berinhard commented 11 years ago

This issue can be closed given the pull request #68