Ejemplo n.º 1
0
def loaduserFeeds(userid, page):
    result = list()
    from models import getFeedsFromDb
    temp_list = getFeedsFromDb(userid)
    #print temp_list
    if page == 1:
        from enrichlist import UserContent, richUserPictures
        user = UserContent(userid)
        content = richUserPictures(user.Pop())
        result.extend(generateFeeds(content.pics))
    else:
        from models import getFeedsFromDb
        from enrichlist import UserContent, richUserPictures
        db_feedList = getFeedsFromDb(userid)
        content = richUserPictures(db_feedList,userid)
        result.extend(generateFeeds(content.pics))
    return result
Ejemplo n.º 2
0
def loaduserFeeds(userid, page):
    result = list()
    from models import getFeedsFromDb
    temp_list = getFeedsFromDb(userid)
    #print temp_list
    if page == 1:
        from enrichlist import UserContent, richUserPictures
        user = UserContent(userid)
        content = richUserPictures(user.Pop())
        for pic in content.pics:
            feed = dict(picid=pic.pic_id, picuid=pic.pic_uid, username=pic.pic_userName, url=pic.pic_url, time=pic.pic_time,comments=pic.commentList, likeCount=pic.likeCount,  liked=pic.liked)
            result.append(feed)
    else:
        from models import getFeedsFromDb
        from enrichlist import UserContent, richUserPictures
        db_feedList = getFeedsFromDb(userid)
        content = richUserPictures(db_feedList,userid)
        for pic in content.pics:
            feed = dict(picid=pic.pic_id, picuid=pic.pic_uid, username=pic.pic_userName, url=pic.pic_url, time=pic.pic_time, comments=pic.commentList, likeCount=pic.likeCount, liked=pic.liked, tags=pic.tags)
            result.append(feed)
    return result
Ejemplo n.º 3
0
def getUserFavorite(userid):
    result=list()
    if userid<=0:
        return None
    else:
        from models import getUserFavioritePic
        from enrichlist import UserContent, richUserPictures
        favioriteList=getUserFavioritePic(userid)
        if favioriteList is not None:
            content = richUserPictures(favioriteList,userid)
            feeds=generateFeeds(content.pics)
            result.extend(feeds)
    return result
Ejemplo n.º 4
0
def getUserFavorite(userid):
    result=list()
    if userid<=0:
        return None
    else:
        from models import getUserFavioritePic
        from enrichlist import UserContent, richUserPictures
        favioriteList=getUserFavioritePic(userid)
        if favioriteList is not None:
            content = richUserPictures(favioriteList,userid)
        for pic in content.pics:
            feed = dict(picid=pic.pic_id, picuid=pic.pic_uid, username=pic.pic_userName, url=pic.pic_url, time=pic.pic_time, comments=pic.commentList, likeCount=pic.likeCount, liked=pic.liked)
            result.append(feed)
    return result
Ejemplo n.º 5
0
def getUserProfilePage(userid):
    if userid<=0:
        return None;
    else:
        from models import followerCount,followingCount,postCount,getUserPosts,getUserProfile,getUserProfilePhoto
        from enrichlist import UserContent, richUserPictures
        userProfile = getUserProfile(userid)
        followers = followerCount(userid)
        followings = followingCount(userid)
        posts = postCount(userid)
        favorites = getUserFavorite(userid)
        userPosts = getUserPosts(userid)
        userProfilePhoto = getUserProfilePhoto(userid)
        feeds=list()
        if (userPosts is not None):
            content = richUserPictures(userPosts,userid)
            feeds.extend(generateFeeds(content.pics))
        result = dict(userProfile=userProfile,userProfileUrl=userProfilePhoto,followers=followers,followings=followings,posts=posts, favorites=favorites,userFeeds=feeds)
        return result
Ejemplo n.º 6
0
def getUserProfilePage(userid):
    if userid<=0:
        return None;
    else:
        from models import followerCount,followingCount,postCount,getUserPosts,getUserProfile,getUserProfilePhoto
        from enrichlist import UserContent, richUserPictures
        userProfile=getUserProfile(userid)
        followers=followerCount(userid)
        followings=followingCount(userid)
        posts=postCount(userid)
        favorites=getUserFavorite(userid)
        userPosts=getUserPosts(userid)
        userProfilePhoto=getUserProfilePhoto(userid)
        feeds=list()
        if (userPosts is not None):
            content = richUserPictures(userPosts,userid)
        for pic in content.pics:
            feed = dict(picid=pic.pic_id, picuid=pic.pic_uid, username=pic.pic_userName, url=pic.pic_url, time=pic.pic_time, comments=pic.commentList, likeCount=pic.likeCount, liked=pic.liked)
            feeds.append(feed)
        result=dict(userProfile=userProfile,userProfileUrl=userProfilePhoto,followers=followers,followings=followings,posts=posts, favorites=favorites,userFeeds=feeds)
        return result