ccollins/milkman — pull request #18 by klen (2012-09-24 14:09:54+00:00)
Title: milkman.random

Hello Chuck!

First, thanks for your awesome module!

Second, sorry for my english.

Third, I have added some features to milkman, as "milkman.random" property. Some code can explain my idea:

from milkman.dairy import milkman
from myapp.models import Video, Editor

# I just want a random video in the db to test with
v = milkman.deliver(Video)

# I want a video with a particular editor
e = milkman.deliver(Editor)
v = milkman.deliver(Video, editor=e)

# I want a video with a random editor from exists
v = milkman.deliver(Video, editor=milkman.random)

# Force optional field generation
v = milkman.deliver(Video, description=milkman.random)

Would you be added this pull request in milkman?