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


Python User.email方法代码示例

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


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

示例1: create_user

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import email [as 别名]
    def create_user(self):
        ''' Add user to the database '''
        if User.by_handle(self.get_argument('handle', '')) is not None:
            raise ValidationError("This handle is already registered")
        if self.get_argument('pass1', '') != self.get_argument('pass2', ''):
            raise ValidationError("Passwords do not match")
        user = User()
        user.handle = self.get_argument('handle', '')
        user.password = self.get_argument('pass1', '')
        user.bank_password = self.get_argument('bpass', '')
        user.name = self.get_argument('playername', '')
        user.email = self.get_argument('email','')
        team = self.get_team()
        self.dbsession.add(user)
        self.dbsession.add(team)
        self.dbsession.commit()

         # Avatar
        avatar_select = self.get_argument('user_avatar_select', '')
        if avatar_select and len(avatar_select) > 0:
            user._avatar = avatar_select
        elif hasattr(self.request, 'files') and 'avatar' in self.request.files:
            user.avatar = self.request.files['avatar'][0]['body']
        team.members.append(user)
        if not options.teams:
            if avatar_select and len(avatar_select) > 0:
                team._avatar = avatar_select
            elif hasattr(self.request, 'files') and 'avatar' in self.request.files:
                team.avatar = self.request.files['avatar'][0]['body']  
        self.dbsession.add(user)
        self.dbsession.add(team)
        self.dbsession.commit()  
        self.event_manager.user_joined_team(user)
        return user
开发者ID:moloch--,项目名称:RootTheBox,代码行数:36,代码来源:PublicHandlers.py

示例2: create_user

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import email [as 别名]
	def create_user(self):
		u = User(_DBCON)
		u.email = self.EMAIL
		u.password = self.PASSWORD
		u.save()

		return u
开发者ID:iamcm,项目名称:bottle-inventory,代码行数:9,代码来源:user_test.py

示例3: create_user

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import email [as 别名]
	def create_user(self, email='[email protected]', password='passpass', valid=True):
		u = User(self.conn)
		u.email = email
		u.password = password
		u.valid = valid
		u.save()

		return u
开发者ID:iamcm,项目名称:jug,代码行数:10,代码来源:BaseTest.py

示例4: set_user_details

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import email [as 别名]
 def set_user_details(self, un, em, psw, fn=None, ls=None):
     user1 = User()
     user1.user_name = un
     user1.email = em
     user1.user_password = psw
     user1.first_name = fn
     user1.last_name = ls
     self.us_list.append(user1)
     print self.us_list
     return self.us_list
开发者ID:shaipeer,项目名称:ATTENDER,代码行数:12,代码来源:DAL.py

示例5: create_activated_user

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import email [as 别名]
	def create_activated_user(self):
		"""
		shortcut to save having to activate the user each time we 
		create one
		"""
		u = User(_DBCON)
		u.email = self.EMAIL
		u.password = self.PASSWORD
		u.valid = True
		u.save()

		return u
开发者ID:iamcm,项目名称:bottle-inventory,代码行数:14,代码来源:user_test.py

示例6: create_user

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import email [as 别名]
def create_user():
    new = User()
    try:
        new.school = request.form["school"]
        new.name = request.form["name"]
        new.admission_year = request.form["admission_year"]
        new.email = request.form["email"]
        new.password = request.form["password"]
    except:
        pass

    new.photo_url = request.form.get("photo_url", None)

    db.session.add(new)
    db.session.commit()
    return jsonify({"result": "succces", "description": "create_user"})
开发者ID:SanghoYoon,项目名称:FuckingNEIS,代码行数:18,代码来源:happen.py


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