From 92940398a682609fc10f470e81121112bd360324 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 11 Sep 2012 14:35:58 +0200 Subject: [PATCH] update channels daily --- pandora/tv/tasks.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 pandora/tv/tasks.py diff --git a/pandora/tv/tasks.py b/pandora/tv/tasks.py new file mode 100644 index 000000000..23d90755a --- /dev/null +++ b/pandora/tv/tasks.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# vi:si:et:sw=4:sts=4:ts=4 +from datetime import timedelta, datetime + +from celery.task import task +from django.contrib.auth.models import User + +import models + +@periodic_task(run_every=timedelta(days=1), queue='encoding') +def update_program(**kwargs): + user = User.objects.all()[0] + for c in models.Channel.objects.all(): + c.json(user)