コード例 #1
0
 def update_talk_by_prompt(self, id): 
     presentation = self.db.get_presentation(id)
     if presentation:                  
         print "#### You have choosen to edit the following talk ###"
         
         self.show_talk_by_id(id)     
                             
         new_title = raw_input("Type the new presentation title (<ENTER> to keep old data): ")
         title = new_title if len(new_title) > 0 else presentation.title
             
         new_speaker = raw_input("Type the new presentation speaker (<ENTER> to keep old data): ")
         speaker = new_speaker if len(new_speaker) > 0 else presentation.speaker
             
         new_room = raw_input("Type the new room where the presentation will be performed (<ENTER> to keep old data): ")  
         room = new_room if len(new_room) > 0 else presentation.room
         
         new_event = raw_input("Type the new event that held the presentation (<ENTER> to keep old data): ")
         event = new_event if len(new_event) > 0 else presentation.event
             
         
         
         new_presentation = Presentation("")
         
         new_presentation.talk_id = id
         new_presentation.title = title
         new_presentation.speaker = speaker
         new_presentation.event = event
         new_presentation.room = room
         
         self.db.update_presentation(id, new_presentation)
         
         print "### Talk Updated! ###"
         
     else:
         print "There's no such presentation"