Esempio n. 1
0
def view_broadcast(request, b_id):
    broadcast = get_object_or_404(Broadcast, pk=b_id)
    if request.method == "POST":
        form = SettingBroadcastForm(request.POST, instance=broadcast)
        if form.is_valid():
            form.save()

            return HttpResponseRedirect(reverse("broadcast"))
    else:
        form = SettingBroadcastForm(instance=broadcast)

    return render_to_response(
        "message/view_broadcast.html", {"broadcast": broadcast, "form": form}, context_instance=RequestContext(request)
    )
Esempio n. 2
0
def broadcast(request):
    if request.method == "POST":
        form = SettingBroadcastForm(request.POST)
        if form.is_valid():
            form.save()

            return HttpResponseRedirect(reverse("broadcast"))
    else:
        form = SettingBroadcastForm()

    broadcasts = Broadcast.objects.all()

    return render_to_response(
        "message/broadcast.html", {"broadcasts": broadcasts, "form": form}, context_instance=RequestContext(request)
    )
Esempio n. 3
0
def view_broadcast(request, b_id):
    broadcast = get_object_or_404(Broadcast, pk=b_id)
    if request.method == "POST":
        form = SettingBroadcastForm(request.POST, instance=broadcast)
        if form.is_valid():
            form.save()

            return HttpResponseRedirect(reverse('broadcast'))
    else:
        form = SettingBroadcastForm(instance=broadcast)

    return render_to_response("message/view_broadcast.html", {
        "broadcast": broadcast,
        "form": form,
    },
                              context_instance=RequestContext(request))
Esempio n. 4
0
def broadcast(request):
    if request.method == "POST":
        form = SettingBroadcastForm(request.POST)
        if form.is_valid():
            form.save()

            return HttpResponseRedirect(reverse('broadcast'))
    else:
        form = SettingBroadcastForm()

    broadcasts = Broadcast.objects.all()

    return render_to_response("message/broadcast.html", {
        "broadcasts": broadcasts,
        "form": form,
    },
                              context_instance=RequestContext(request))