views.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Location_Assistance 作者: KamalAwasthi 项目源码 文件源码
def delete_friends(request):
    current_username = request.POST.get('username')
    current_friendName = request.POST.get('friendUsername')
    ol=[]
    try:
        existingUser = FriendList.objects.get(user__username = current_username)
        user_friends = existingUser.getfoo()
        for c in user_friends:
            c = unicodedata.normalize('NFKD', c).encode('ascii','ignore')
            if(c == current_friendName):
                continue
            ol.append(c)
        existingUser.friendList = json.dumps(ol)
        existingUser.save()
    except:
        ol=[]
    return HttpResponse(json.dumps(ol))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号