2012-02-13 05:50:54 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vi:si:et:sw=4:sts=4:ts=4
|
|
|
|
|
|
|
|
from celery.task import task
|
|
|
|
|
|
|
|
import models
|
|
|
|
|
|
|
|
|
2012-03-21 08:13:38 +00:00
|
|
|
@task(ignore_results=True, queue='default')
|
2012-02-13 05:50:54 +00:00
|
|
|
def parse_data(key):
|
|
|
|
session_data = models.SessionData.objects.get(session_key=key)
|
|
|
|
session_data.parse_data()
|
2012-03-03 11:40:53 +00:00
|
|
|
session_data.save()
|
2012-03-20 18:38:18 +00:00
|
|
|
|
2012-03-21 08:13:38 +00:00
|
|
|
@task(ignore_results=True, queue='default')
|
2012-03-20 18:38:18 +00:00
|
|
|
def update_numberoflists(username):
|
|
|
|
user = models.User.objects.get(username=username)
|
|
|
|
models.SessionData.objects.filter(
|
|
|
|
user=user
|
|
|
|
).update(
|
|
|
|
numberoflists=user.lists.count()
|
|
|
|
)
|