コード例 #1
0
ファイル: views.py プロジェクト: juandisay/sms-komunitas
def view_social(request, sos_id):
    social = get_object_or_404(StatusSosial, pk=sos_id)
    
    if request.method == 'POST':
        form = StatusSosialForm(request.POST, instance=social)
        if form.is_valid():
            form.save()
            
            return HttpResponseRedirect(reverse('setting_social'))
    else:
        form = StatusSosialForm(instance=social)
        
    return render_to_response("member/view_social.html",
                              {"social": social, "form": form, },
                              context_instance=RequestContext(request))
コード例 #2
0
ファイル: views.py プロジェクト: juandisay/sms-komunitas
def settings_social(request):
    if request.method == 'POST':
        form = StatusSosialForm(request.POST)
        if form.is_valid():
            form.save()
            
            return HttpResponseRedirect(reverse('setting_social'))
    else:
        form = StatusSosialForm()
        
    statuses = StatusSosial.objects.all()
    
    return render_to_response('member/settings_social.html',
                              {"statuses": statuses, "form": form,},
                              context_instance=RequestContext(request))
コード例 #3
0
def view_social(request, sos_id):
    social = get_object_or_404(StatusSosial, pk=sos_id)

    if request.method == 'POST':
        form = StatusSosialForm(request.POST, instance=social)
        if form.is_valid():
            form.save()

            return HttpResponseRedirect(reverse('setting_social'))
    else:
        form = StatusSosialForm(instance=social)

    return render_to_response("member/view_social.html", {
        "social": social,
        "form": form,
    },
                              context_instance=RequestContext(request))
コード例 #4
0
def settings_social(request):
    if request.method == 'POST':
        form = StatusSosialForm(request.POST)
        if form.is_valid():
            form.save()

            return HttpResponseRedirect(reverse('setting_social'))
    else:
        form = StatusSosialForm()

    statuses = StatusSosial.objects.all()

    return render_to_response('member/settings_social.html', {
        "statuses": statuses,
        "form": form,
    },
                              context_instance=RequestContext(request))