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))
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))
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))
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))