示例#1
0
def waiting_list(request):
    if request.method == "POST":
        form = WaitingListForm(request.POST)
        if form.is_valid():
            form.save()
            messages.success(request, "I'll contact you as soon as space is available")
            return redirect("home")
    else:
        form = WaitingListForm()

    return TemplateResponse(request, "waiting-list.html", {"form": form})
示例#2
0
文件: views.py 项目: sebbacon/trevor
def home2(request):
    if request.method == 'POST':
        waiting = WaitingListForm(request.POST)
        if waiting.is_valid():
            item = waiting.save()
            item.save()
            message = "Thanks. We'll let you know when the new game starts!"
        else:
            message = "That's not a valid email address"
    blog_date, blog_title, blog_content = _parseFeed()
    this_year = getThisYear()
    return locals()
示例#3
0
文件: views.py 项目: sebbacon/trevor
def home2(request):
    if request.method == 'POST':
        waiting = WaitingListForm(request.POST)
        if waiting.is_valid():
            item = waiting.save()
            item.save()
            message = "Thanks. We'll let you know when the new game starts!"
        else:
            message = "That's not a valid email address"
    blog_date, blog_title, blog_content = _parseFeed()
    this_year = getThisYear()
    return locals()
示例#4
0
文件: views.py 项目: sebbacon/trevor
def home(request):
    if request.method == 'POST':
        waiting = WaitingListForm(request.POST)
        if waiting.is_valid():
            item = waiting.save()
            item.save()
            message = "Thanks. We'll let you know when the new game starts!"
        else:
            message = "That's not a valid email address"
    blog_date, blog_title, blog_content = _parseFeed()
    this_year = getThisYear()
    predictions = Prediction.objects.filter(year=this_year)
    predictions = predictions.order_by('-score', '-goaldiff', 'created_date')
    predictions = predictions.all()[:10]
    return locals()
示例#5
0
文件: views.py 项目: sebbacon/trevor
def home(request):
    if request.method == 'POST':
        waiting = WaitingListForm(request.POST)
        if waiting.is_valid():
            item = waiting.save()
            item.save()
            message = "Thanks. We'll let you know when the new game starts!"
        else:
            message = "That's not a valid email address"
    blog_date, blog_title, blog_content = _parseFeed()
    this_year = getThisYear()
    predictions = Prediction.objects.filter(year=this_year)
    predictions = predictions.order_by('-score', '-goaldiff', 'created_date')
    predictions = predictions.all()[:10]
    return locals()