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
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