本文整理汇总了Python中auth_systems.AUTH_SYSTEMS.has_key方法的典型用法代码示例。如果您正苦于以下问题:Python AUTH_SYSTEMS.has_key方法的具体用法?Python AUTH_SYSTEMS.has_key怎么用?Python AUTH_SYSTEMS.has_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth_systems.AUTH_SYSTEMS
的用法示例。
在下文中一共展示了AUTH_SYSTEMS.has_key方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: can_create_election
# 需要导入模块: from auth_systems import AUTH_SYSTEMS [as 别名]
# 或者: from auth_systems.AUTH_SYSTEMS import has_key [as 别名]
def can_create_election(self):
"""
Certain auth systems can choose to limit election creation
to certain users.
"""
if not AUTH_SYSTEMS.has_key(self.user_type):
return False
return AUTH_SYSTEMS[self.user_type].can_create_election(self.user_id, self.info)
示例2: send_message
# 需要导入模块: from auth_systems import AUTH_SYSTEMS [as 别名]
# 或者: from auth_systems.AUTH_SYSTEMS import has_key [as 别名]
def send_message(self, subject, body):
if AUTH_SYSTEMS.has_key(self.user_type):
subject = subject.split("\n")[0]
AUTH_SYSTEMS[self.user_type].send_message(self.user_id, self.name, self.info, subject, body)
示例3: update_status
# 需要导入模块: from auth_systems import AUTH_SYSTEMS [as 别名]
# 或者: from auth_systems.AUTH_SYSTEMS import has_key [as 别名]
def update_status(self, status):
if AUTH_SYSTEMS.has_key(self.user_type):
AUTH_SYSTEMS[self.user_type].update_status(self.user_id, self.info, self.token, status)
示例4: can_update_status
# 需要导入模块: from auth_systems import AUTH_SYSTEMS [as 别名]
# 或者: from auth_systems.AUTH_SYSTEMS import has_key [as 别名]
def can_update_status(self):
if not AUTH_SYSTEMS.has_key(self.user_type):
return False
return AUTH_SYSTEMS[self.user_type].STATUS_UPDATES
示例5: public_url
# 需要导入模块: from auth_systems import AUTH_SYSTEMS [as 别名]
# 或者: from auth_systems.AUTH_SYSTEMS import has_key [as 别名]
def public_url(self):
if AUTH_SYSTEMS.has_key(self.user_type):
if hasattr(AUTH_SYSTEMS[self.user_type], 'public_url'):
return AUTH_SYSTEMS[self.user_type].public_url(self.user_id)
return None
示例6: send_notification
# 需要导入模块: from auth_systems import AUTH_SYSTEMS [as 别名]
# 或者: from auth_systems.AUTH_SYSTEMS import has_key [as 别名]
def send_notification(self, message):
if AUTH_SYSTEMS.has_key(self.user_type):
if hasattr(AUTH_SYSTEMS[self.user_type], 'send_notification'):
AUTH_SYSTEMS[self.user_type].send_notification(self.user_id, self.info, message)