heynemann / motorengine

Motorengine is a port of MongoEngine for Tornado.
http://motorengine.readthedocs.org
204 stars 67 forks source link

yield and return? #57

Closed ghost closed 10 years ago

ghost commented 10 years ago
def get_active_users():
    users = yield User.objects.filter(active=True).find_all()
    return users

hi, i saw above at doc. return value in generator?

ghost commented 10 years ago

oh, new feature in python 3.3.

heynemann commented 10 years ago

Exactly ;)

If you are using 2.7, you can use Tornado's http://www.tornadoweb.org/en/stable/gen.html#tornado.gen.Return

heynemann commented 10 years ago

Btw are you using or trying to use motorengine? would love the feedback.

ghost commented 10 years ago

Yes. with pleasure:)