def pictures_for_userid(cls, fb_id): print fb_id persistence_controller = PersistenceController() user = persistence_controller.get_user(fb_id) print user.fb_id pictures_list = persistence_controller.get_pictures_by_user(user) print pictures_list return pictures_list
def populate(): ## creating user fb_id = '677153213' persistence_controller = PersistenceController() persistence_controller.new_user(fb_id=fb_id) users = UserModel.objects.all() user0 = users[0] auth = Auth(user0.fb_id) scrapper = Scrapper(auth) pictures = scrapper.scrap_album() persistence_controller = PersistenceController() persistence_controller.add_pictures(user=user0, pictures=pictures)