当前位置: 首页>>代码示例>>Python>>正文


Python Subscription.fone方法代码示例

本文整理汇总了Python中subscription.models.Subscription.fone方法的典型用法代码示例。如果您正苦于以下问题:Python Subscription.fone方法的具体用法?Python Subscription.fone怎么用?Python Subscription.fone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在subscription.models.Subscription的用法示例。


在下文中一共展示了Subscription.fone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: inscricao

# 需要导入模块: from subscription.models import Subscription [as 别名]
# 或者: from subscription.models.Subscription import fone [as 别名]
def inscricao(request):
    if request.method == 'POST':
        form = SubscriptionForm(request.POST)
        if form.is_valid():
            subscription = Subscription()
            subscription.nome = form.cleaned_data['nome']
            subscription.cpf = form.cleaned_data['cpf']
            subscription.email = form.cleaned_data['email']
            subscription.fone = form.cleaned_data['fone']
            subscription.save()
            try:
                send_mail(
                    subject = u'Inscrição no EventeX',
                    message = u'Obrigado por se inscrever no EventeX!',
                    from_email = '[email protected]',
                    recipient_list = [request.POST['email']],
                )
            except:
                pass
            return sucesso(request, subscription.pk)
#            messages = (u'Inscrição realizada com sucesso;', u'Aguarde até que sua solicitação de cadastro seja aprovada')
#            return render_to_response('index.html',{'messages':messages, 'subscription': subscription.pk}, context_instance=RequestContext(request))
    else:
        form = SubscriptionForm(initial={
                 'nome':'Entre com o seu nome',
                 'cpf':'Digite o seu CPF sem pontos',
                 'email': 'Informe o seu email',
                 'fone' :  'Qual seu telefone de contato?',
        })
    return render_to_response('subscription/subscription_form.html',{'form': form, 'title' : u'Preencha Sua Inscrição'}, context_instance=RequestContext(request))
开发者ID:iorgama,项目名称:eventex,代码行数:32,代码来源:views.py


注:本文中的subscription.models.Subscription.fone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。