예제 #1
0
def fanout(operation, activity, recipients, feed):
    """
    Fanout is called in celery task and is responsible for distributing the actions into the
    destination feeds.
    """
    activity = Activity.deserialize(activity)
    feed = apps.get_model("feeds", feed)

    if operation == ADD:
        return add_to_feed(activity, feed, recipients)

    elif operation == REMOVE:
        return remove_from_feed(activity, feed, recipients)

    raise ValueError("Invalid feed operation")
예제 #2
0
파일: models.py 프로젝트: vhellem/lego
 def activities(self):
     return [
         Activity.deserialize(activity) for activity in self.activity_store
     ]