def getData(handle): data = [] handle_id=getId(handle) for p in NPostsdatanew.objects.raw("select * from N_Postsdatanew where pageid='"+handle+"' && fromid!='"+handle_id+"'"): # print p.__dict__ # print type(p) data.append(p.__dict__) return data
def getData(handle): data = [] handle_id = getId(handle) # for p in NPostsdatanew.objects.raw("select * from N_Postsdatanew where pageid='"+handle+"' && fromid!='"+handle_id+"'"): for p in NPostsdatanew.objects.raw( "select * from N_Postsdatanew where pageid='" + handle + "'"): # print p.__dict__ # print type(p) data.append(p.__dict__) return data
def getUniqueDataSentiment(handle): data = [] handle_id=getId(handle) # for p in NPostsdatanew.objects.raw("select * from N_Postsdatanew where pageid='"+handle+"'"): for p in NPostsdatanew.objects.raw("select * from N_Postsdatanew where pageid='"+handle+"' && sentiment=-1"): # print p.__dict__ # print type(p) if "message" not in p.__dict__.keys(): continue if p.__dict__["message"]=="not found": continue data.append(p.__dict__) return data
def getUniqueDataSentiment(handle): data = [] handle_id = getId(handle) # for p in NPostsdatanew.objects.raw("select * from N_Postsdatanew where pageid='"+handle+"'"): for p in NPostsdatanew.objects.raw( "select * from N_Postsdatanew where pageid='" + handle + "' && sentiment=-1"): # print p.__dict__ # print type(p) if "message" not in p.__dict__.keys(): continue if p.__dict__["message"] == "not found": continue data.append(p.__dict__) return data