예제 #1
0
파일: tasks.py 프로젝트: h1ds/h1ds
def test_signal(sender=None, task_id=None, task=None, args=None, kwargs=None, **kwds):
    if sender == 'h1ds.tasks.populate_tree_success':  #TODO should be able to put this in connect - but not working?
        from h1ds.models import Device
        from h1ds_summary.db import SummaryTable
        device_slug, shot_number, tree = args[0]
        # TODO: should this be a celery task?
        device = Device(slug=device_slug)
        db = SummaryTable(device)
        db.add_or_update_shot(shot_number)
예제 #2
0
파일: tasks.py 프로젝트: h1ds/h1ds
def update_from_shot_slug(device_slug, shot_slug):
    from h1ds_summary.db import SummaryTable
    device = Device(slug=device_slug)
    db = SummaryTable(device)
    for shot in parse_shot_slug(device, shot_slug):
        db.add_or_update_shot(shot)