Ejemplo n.º 1
0
def post(request):
    last_feed = request.POST.get('last_feed')
    user = request.user
    csrf_token = unicode(csrf(request)['csrf_token'])
    feed = Feed()
    feed.user = user
    feed.post = request.POST['post']
    feed.save()
    html = _html_feeds(last_feed, user, csrf_token)
    return HttpResponse(html)
Ejemplo n.º 2
0
def post(request):
    last_feed = request.POST.get('last_feed')
    user = request.user
    csrf_token = (csrf(request)['csrf_token'])
    feed = Feed()
    feed.user = user
    post = request.POST['post']
    post = post.strip()
    if len(post) > 0:
        feed.post = post[:255]
        feed.save()
    html = _html_feeds(last_feed, user, csrf_token)
    return HttpResponse(html)
Ejemplo n.º 3
0
def post(request):
    last_feed = request.POST.get('last_feed')
    user = request.user
    csrf_token = unicode(csrf(request)['csrf_token'])
    feed = Feed()
    feed.user = user
    post = request.POST['post']
    post = post.strip()
    if len(post) > 0:
        feed.post = post[:255]
        feed.save()
    tag = request.session.get('TRIBE_TAG')
    html = _html_feeds(tag, last_feed, user, csrf_token)
    return HttpResponse(html)
Ejemplo n.º 4
0
def post(request):
    last_feed = request.POST.get('last_feed')
    user = request.user
    csrf_token = (csrf(request)['csrf_token'])
    feed = Feed()
    feed.user = user
    form = MultipleInputFileForm(request.POST)
    post = request.POST['post']
    post = post.strip()
    if len(post) > 0 or form.is_valid():
        feed.post = post[:255]
        feed.save()
        if form.is_valid():
            for f in form.cleaned_data['input_file']:
                InputFile.objects.create(
                    feed=feed,
                    input_file=f
                )
            form.delete_temporary_files()

    html = _html_feeds(last_feed, user, csrf_token)
    return HttpResponse(html)