本文整理匯總了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)