예제 #1
0
def subscribe(req):
    html = req.POST['html']
    url = req.POST['url']
    tags = simplejson.loads(req.POST['tags'])
    user = _user(req)
    article, created = Article.objects.get_or_create(user=user, url=url)
    article.html = html
    article.state = 'UNREAD'
    article.deleted = False
    article.tags.add(*tags);
    article.save()
    process_article_task(user.id, url, html)
    return reading_count(req)
예제 #2
0
def reload(request):
    user = _user(request)
    a = Article.objects.get(pk=request.POST['article_id'])
    process_article_task(user.id, a.url, a.html)
    return HttpResponseRedirect(reverse('reader:articles'))