Example #1
0
def removePhotoEvent(userid, pic_id):
    if (userid>0 and pic_id>0):
        from models import removePhoto
        result=removePhoto(userid,pic_id)
        if result is True:
            from pin_feed import User
            user_pin = User(userid)
            from feed_managers import manager
            manager.remove_user_activity(userid,user_pin.add_pic(pic_id))
            return True
        else:
            return False
Example #2
0
def addphotoEvent(userid, RelativePath, Saved_file_name, tags):
    if userid > 0 and RelativePath != '' and Saved_file_name != '':
        from models import addphoto, addphotoTags
        pic_id = addphoto(userid, 'photoname', 'photoDescription', RelativePath, Saved_file_name)
        if pic_id>0:
            addphotoTags(pic_id,tags)

            from pin_feed import User
            user_pin = User(userid)
            # user_pin.add_pic(pic_id)
            from feed_managers import manager
            manager.add_user_activity(userid, user_pin.add_pic(pic_id))
            #feeds = manager.get_feeds(1)['normal']
            #print (feeds[:])
        return pic_id
    else:
        return 0
Example #3
0
#session.add(itemDB)

User1DB=UserModel(id=2,password=123)
#session.add(User1DB)
PinDB=Pin(id=12,user_id=1)
#session.add(PinDB)

itemDB=Item(id=102,user_id=2,image='img2', pin_count=0)
#session.add(itemDB)
#feeds= manager.get_feeds(1)['normal']
#feeds.delete()
#feeds= manager.get_feeds(2)['normal']
#feeds.delete()

from pin_feed import User
user1=User(1)
#user1.delete()
user1.create_pic(64)
user2=User(2)
#user2.delete()
user2.create_pic(12)
user2.create_comment(101,11)

#manager.follow_user(user2.user_id,user1.user_id)
#manager.follow_user(user1.user_id,user2.user_id)

# user3=User(3)
# user3.create_pic(13)
#
# user4=User(4)
# user4.create_pic(14)