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

Consider signal dispatcher integration #24

Closed
mattdennewitz opened this issue Feb 15, 2010 · 3 comments
Closed

Consider signal dispatcher integration #24

mattdennewitz opened this issue Feb 15, 2010 · 3 comments

Comments

@mattdennewitz
Copy link

MongoDB offers no relationship management, so post_save and post_delete signals (at the very least) would help keep denormalized data clean. Django has an excellent fork/refactoring of PyDispatcher, and PyDispatcher itself may fit the bill.

@iapain
Copy link

iapain commented Mar 19, 2010

+1 and should be included in v0.4. Signal hooks needs to reside within ORM which means we need to alter quite a bit. I am okay with PyDispatcher but for sure we have to tweak a bit to fit into mongoengine.

@theojulienne
Copy link

I'm working on this now. So far I've extracted Django's dispatch framework into it's own project, and added an extra decorator. Tests and docs coming next.

theojulienne/mongoengine@ab24dcf

Usage:
from mongoengine.signals import post_save, post_delete

class SomeDocument(Document):
    ...

@post_save.receive( sender=SomeDocument )
def do_something_save( instance, *args, **kwargs ):
    print instance, 'was just saved'

@post_delete.receive( sender=SomeDocument )
def do_something_delete( instance, *args, **kwargs ):
    print instance, 'was just deleted'

@rozza
Copy link

rozza commented Jun 17, 2011

This is now implemented in dev using blinker.

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

No branches or pull requests

4 participants