예제 #1
0
def event_post_save(sender, instance, signal, *args, **kwargs):
    """Starts a Task when an Event is created"""
    from hackday.tasks import add, start
    from celery import group
#
#
#    print 'dfdf ' + instance.name
#    print
#    print
#
#    t_name = 'pf-thread01'
#    posts = Post.objects.filter(thread__name=t_name).all()
#
#    for p in posts:
##        print dir(t)
#        print p.thread.name
#        print p.name


#    c = len(threads.objects)
#    c = posts.count()
#    info = 'Object count: %s' % (c)

    print 'Received "%s" for processing' % (instance.name)

    start.delay(instance.name)
예제 #2
0
파일: models.py 프로젝트: brianly/demobot
def event_post_save(sender, instance, signal, *args, **kwargs):
    """Starts a Task when an Event is created"""
    from hackday.tasks import start

    print 'Received "%s" for processing' % (instance.name)
    start.delay(instance.name)