本文整理汇总了Python中userprofile.models.UserProfile.getMutualFriends方法的典型用法代码示例。如果您正苦于以下问题:Python UserProfile.getMutualFriends方法的具体用法?Python UserProfile.getMutualFriends怎么用?Python UserProfile.getMutualFriends使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类userprofile.models.UserProfile
的用法示例。
在下文中一共展示了UserProfile.getMutualFriends方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createStatusJsonObject
# 需要导入模块: from userprofile.models import UserProfile [as 别名]
# 或者: from userprofile.models.UserProfile import getMutualFriends [as 别名]
def createStatusJsonObject(status, userProfile = None):
statusData = dict()
statusData['statusid'] = status.id
statusData['userid'] = status.user_id
statusData['userinfo'] = getUserProfileDetailsJson(status.user)
statusData['text'] = status.text
statusData['datecreated'] = status.dateCreated.strftime(DATETIME_FORMAT)
statusData['dateexpires'] = status.expires.strftime(DATETIME_FORMAT)
statusData['datestarts'] = status.starts.strftime(DATETIME_FORMAT)
statusData['type'] = status.statusType
statusData['deleted'] = status.deleted
attending, invited, userDetails = createAttendingAndInvitedAndUserDetailsJsonResponse(status)
statusData['invited'] = invited
statusData['attending'] = attending
statusData['users'] = userDetails
statusData['imageorientation'] = status.imageOrientation
if status.imageUrl:
statusData['imageurl'] = status.imageUrl
if status.location:
statusData['location'] = createLocationJson(status.location)
if userProfile is not None:
# if status.visibility == Status.VIS_FRIENDS_OF_FRIENDS or status.visibility == Status.VIS_PUBLIC:
statusData['mutualfriends'] = UserProfile.getMutualFriends(status.user_id, userProfile.id)
return statusData
示例2: testMutalFriends
# 需要导入模块: from userprofile.models import UserProfile [as 别名]
# 或者: from userprofile.models.UserProfile import getMutualFriends [as 别名]
def testMutalFriends(self):
print("Mutal Friends Test")
data = UserProfile.getMutualFriends(self.userProfile.id, self.userProfile2.id)
userid = data[0]['userid']
self.assertEqual(userid, self.userProfile3.id)