def save_question(data, image_file): if image_file: data['imageUrl'] = str(upload_file(image_file, True)) else: data['imageUrl'] = u'' data['correctAnswer'] = int(data['correctAnswer']) datastore.save_question(data) return
def save_question(data, image_file): if image_file: data['imageUrl'] = unicode(upload_file(image_file, True)) else: data['imageUrl'] = u'' data['correctAnswer'] = int(data['correctAnswer']) datastore.save_question(data) return
def save_question(data, image_file): # TODO: If there is an image file, then upload it # And assign the result to a new Datastore property imageUrl # If there isn't, assign an empty string # END TODO data['correctAnswer'] = int(data['correctAnswer']) datastore.save_question(data) return
def save_question(data, image_file): # TODO: If there is an image file, then upload it # And assign the result to a new Datastore property imageUrl # If there isn't, assign an empty string if image_file: data['imageUrl'] = unicode(upload_file(image_file, True)) else: data['imageUrl'] = u'' # END TODO data['correctAnswer'] = int(data['correctAnswer']) datastore.save_question(data) return
def save_question(data): data['correctAnswer'] = int(data['correctAnswer']) datastore.save_question(data) return