Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ae4467c960
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (15 sloc) 0.503 kb
from django.db.models import signals
from ratings.models import RatedItem
def update_rating_score(sender, instance, *args, **kwargs):
instance.content_object.update_rating()
def start_listening():
signals.post_save.connect(
update_rating_score,
sender=RatedItem,
dispatch_uid='cab.snippets.save_rating_score',
)
signals.post_delete.connect(
update_rating_score,
sender=RatedItem,
dispatch_uid='cab.snippets.delete_rating_score',
)
Jump to Line
Something went wrong with that request. Please try again.