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


Python User.email_feedback方法代码示例

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


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

示例1: _add_user

# 需要导入模块: from user.models import User [as 别名]
# 或者: from user.models.User import email_feedback [as 别名]
def _add_user(request, email, password, band_id, facebook = "", name = "", country = ""):
    #import ipdb; ipdb.set_trace()
    key = hashlib.md5(email).hexdigest()

    try:
        country = Country.objects.get(id=country)
    except:
        country = Country.objects.get(id=1)

    if not facebook:
        confirmed = 0
        try:
            html = "Hello!"
            html = html + "<br><br>To confirm your vote "
            html = html + "<a href='http://rockranking.com/user/validate/" + key + "/'>click here</a>"
            html = html + "<br><br>If you can not access the link, please copy this"
            html = html + "<br>http://rockranking.com/user/validate/" + key + "/"
            html = html + "<br>and paste in your browser"
            html = html + "<br><br>Rock Ranking Team \m/"

            _send_email(email,html)
            email_feedback = 'sent'
        except:
            email_feedback = 'error to sent'
    else:
        confirmed = 1
        email_feedback = 'facebook login'
    try:
        user = User()
        user.username = ""
        user.name = name
        user.email = email
        user.password = hashlib.md5(password).hexdigest()
        user.email_feedback = email_feedback
        user.facebook = facebook
        user.country = country
        user.ip = request.META.get('REMOTE_ADDR')
        user.key = key
        user.date = datetime.now()
        user.action = "add_band_%s" % band_id
        user.confirmed = confirmed
        user.save()

        return True

    except:
        return False
开发者ID:allanjuliani,项目名称:rockranking,代码行数:49,代码来源:views.py


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