Beispiel #1
0
def getAttentionCount(request, *args, **kwargs):#获得关注者数量
    if kwargs.get('userid'):
        userid= kwargs.get('userid')
        users=HandleAttentionDb.getAttentionCount(userid)#获得关注数量
        m = {'count': users}
        n = json.dumps(m)  
        lastjson = json.loads(n)  
        return HttpResponse(simplejson.dumps(lastjson,ensure_ascii = False)) 
Beispiel #2
0
def getAttentions(request, *args, **kwargs):#获得关注者具体信息
    if kwargs.get('userid'):
        userid= kwargs.get('userid')
        
        users=HandleAttentionDb.getAttentionsDetail(userid)#调用数据库函数获得所用关注好友信息
        m = {'attentions': users}
        n = json.dumps(m)  
        lastjson = json.loads(n)  
        return HttpResponse(simplejson.dumps(lastjson,ensure_ascii = False))