本文整理汇总了Python中voter.models.VoterManager.fetch_local_id_from_we_vote_id方法的典型用法代码示例。如果您正苦于以下问题:Python VoterManager.fetch_local_id_from_we_vote_id方法的具体用法?Python VoterManager.fetch_local_id_from_we_vote_id怎么用?Python VoterManager.fetch_local_id_from_we_vote_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类voter.models.VoterManager
的用法示例。
在下文中一共展示了VoterManager.fetch_local_id_from_we_vote_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: retrieve_voter_following_org_status
# 需要导入模块: from voter.models import VoterManager [as 别名]
# 或者: from voter.models.VoterManager import fetch_local_id_from_we_vote_id [as 别名]
def retrieve_voter_following_org_status(self, voter_id, voter_we_vote_id,
organization_id, organization_we_vote_id):
"""
Retrieve one follow entry so we can see if a voter is following or ignoring a particular org
"""
if not positive_value_exists(voter_id) and positive_value_exists(voter_we_vote_id):
# We need voter_id to call retrieve_follow_organization
voter_manager = VoterManager()
voter_id = voter_manager.fetch_local_id_from_we_vote_id(voter_we_vote_id)
if not positive_value_exists(voter_id) and \
not (positive_value_exists(organization_id) or positive_value_exists(organization_we_vote_id)):
results = {
'status': 'RETRIEVE_VOTER_FOLLOWING_MISSING_VARIABLES',
'success': False,
'follow_organization_found': False,
'follow_organization_id': 0,
'follow_organization': FollowOrganization(),
'is_following': False,
'is_not_following': True,
'is_ignoring': False,
'error_result': True,
'DoesNotExist': False,
'MultipleObjectsReturned': False,
}
return results
return self.retrieve_follow_organization(0, voter_id, organization_id, organization_we_vote_id)