示例#1
0
文件: views.py 项目: rfapo/eventex
def create(request):
    form = SubscriptionForm(request.POST)
    if not form.is_valid():
        context = RequestContext(request, {'form': form})
        return render_to_response('subscription/new.html', context)
    subscription = form.save()
    return HttpResponseRedirect(reverse('subscription:success', args=[ subscription.pk ]))
示例#2
0
文件: views.py 项目: nbluis/eventex
def create(request):
    form = SubscriptionForm(request.POST)

    if not form.is_valid():
        context = RequestContext(request, {"form": form})
        return render_to_response("subscription/new.html", context)

    subscription = form.save()
    send_subscription_email(subscription)
    return HttpResponseRedirect(reverse("subscription:success", args=[subscription.pk]))
示例#3
0
def create(request):
    form = SubscriptionForm(request.POST)

    if not form.is_valid():
        context = RequestContext(request, {'form': form})
        return render_to_response('subscription/new.html', context)

    subscription = form.save()
    send_subscription_email(subscription)
    return HttpResponseRedirect(
        reverse('subscription:success', args=[subscription.pk]))
示例#4
0
def subscription(request):
    inscricao = True    
    form = SubscriptionForm()
    
    if request.method == "POST":
	form = SubscriptionForm(request.POST)
    
	if not form.is_valid():
	    return render_to_response("subscription/form.html", {"form":form, "inscricao":inscricao}, context_instance=RequestContext(request))
	    
	get_form = form.save()
	return redirect("subscription:subs_success", id=get_form.pk)
    else:
	return render_to_response("subscription/form.html", {"form":form, "inscricao":inscricao}, context_instance=RequestContext(request))
示例#5
0
def create(request):
    form = SubscriptionForm(request.POST)

    if not form.is_valid():
        context = RequestContext(request, {'form': form})
        return render_to_response('subscription/new.html', context)
    
    subscription = form.save()
    send_mail(
        subject = u'Inscrição no Eventex',
        message = u'Obrigado por se inscrever',
        from_email = '*****@*****.**',
        recipient_list = [ '*****@*****.**'],
    )
    return HttpResponseRedirect(reverse('subscription:success', args=[ subscription.pk]))
示例#6
0
def create(request):
    form = SubscriptionForm(request.POST)

    if not form.is_valid():
        context = RequestContext(request, {'form': form})
        return render_to_response('subscription/new.html', context)

    subscription = form.save()
    send_mail(
        subject=u'Inscrição no Eventex',
        message=u'Obrigado por se inscrever',
        from_email='*****@*****.**',
        recipient_list=['*****@*****.**'],
    )
    return HttpResponseRedirect(
        reverse('subscription:success', args=[subscription.pk]))
示例#7
0
def create(request):
    form = SubscriptionForm(request.POST)
    
    if not form.is_valid():
        context = RequestContext(request, {'form': form})
        return render_to_response('subscription/new.html', context)
    
   # model = Subscription(form)
    
    subscription = form.save()
    send_mail(
        subject = u'Inscricao no EventeX',
        message = u'Obrigado por se inscrever no EventeX!',
        from_email = '*****@*****.**',
        recipient_list = [ subscription.email ],
    )

    return HttpResponseRedirect(reverse('subscription:success', args=[ subscription.pk ]))
示例#8
0
文件: views.py 项目: cpac/EventeX
def create(request):

    form = SubscriptionForm(request.POST)
    
    if not form.is_valid():

        context = RequestContext(request, {'form': form})

        return render_to_response('subscription/new.html', context)
        
    subscription = form.save()

    # enviando e-mail
    
    send_mail(
      subject = u'Inscrição no EventeX',
      message = u'Obrigado por se inscrever no EventeX!',
      from_email = '*****@*****.**',
      recipient_list = [ '*****@*****.**' ],
    )
    
    return HttpResponseRedirect(reverse('subscription:success', args=[ subscription.pk ]))