def get(self): p = Page() p.title = "My Page" p.css = "css/style.css" p.body = "this is the body" self.response.write(p.whole_page)
def get(self): # create an instance of the page class - creates a page using this class - it will also call the constructor method p = Page() p.title = "MyPage!" p.body = "Miss piggy loves Kermit da Frog" self.response.write(p.whole_page)
def get(self): p = Page() p.title = "My page!" p.css = "css/style.css" p.body = "Miss Piggy likes Kermit De Frog!" #modify body element self.response.write(p.whole_page)
def get(self): p = Page() p.title = "My page" p.css = "css/styles.css" p.body = "Miss Piggy like Kermit De Frog" self.response.write(p.whole_page)
def get(self): p = Page() lib = FavoriteMovies() #instance for the FavoriteMovies #movie title (this is part of our assignment, making it user input) #year movie was made(this is part of our assignment)(this is our assignment) #director of the film (this is part of our assignment) #for this demo we will be hard-coding the above three line values do not normally do this #page for class (if/else for 2 different page views for assignment) md1 = MovieData() md1.title = "The Princess Bride" md1.year = 1989 #actually calling a function md1.director = "Rob Reiner" md2 = MovieData() md2.title = "Dune" md2.year = 1986 #actually calling a function md2.director = "David Lynch" md3 = MovieData() md3.title = "Star Wars" md3.year = 1977 #actually calling a function md3.director = "George Lucas" #lib.calc_time_span() #adds this to run but we need to add it to the printing out list below p.body = lib.compile_list() + lib.calc_time_span() #adds the compile list to the body tag of the html in the page.py self.response.write(p.print_out()) #sends the info out to browser as a big string
def get(self): p = Page() p.title = 'My Page!' p.css = 'css/style.css' p.body = 'Miss Piggy likes Kermit de Frog' p.update() self.response.write(p.whole_page)
def get(self): p = Page() lib = FavoriteMovies() #USER ENTRY #Movie Title #Year Made #Directory md1 = MovieData() md1.title = "The Princess Bride" md1.director = "Rob Reiner" md1.year = 1989 lib.add_movie(md1) md2 = MovieData() md2.title = "Dune" md2.director = "David Lynch" md2.year = 1986 lib.add_movie(md2) md3 = MovieData() md3.title = "Star Wars" md3.director = "George Lucas" md3.year = 1977 lib.add_movie(md3) p.body = lib.compile_list() self.response.write(p.print_out(p.body, lib.calc_time_span()))
def get(self): #page for class p = Page() lib = FavoriteMovies() #movie title #year movie was made #director of the film md1 = MovieData() md1.title = "The Princess Bride" md1.year = 1989 #actually calling a function md1.director = "Rob Reiner" lib.add_movie(md1) md2 = MovieData() md2.title = "Dune" md2.year = 1986 #actually calling a function md2.director = "David Lynch" lib.add_movie(md2) md2 = MovieData() md2.title = "Star wars" md2.year = 1977 #actually calling a function md2.director = "George Lucas" lib.add_movie(md2) p.body = lib.compile_list() + lib.calc_time_span() self.response.write(p.print_out()) def main(name, GPA): print "The GPA for", name,"is",GPA return 0
def get(self): p = Page() p.title = "My page!" p.css = "css/style.css" p.body = "Miss Piggy likes Kermit De Frog! " #p.update() self.response.write(p.whole_page)
def get(self): # page for class p = Page() lib = FavoriteMovies() #use form to get this info #movie title #movie year #director md1 = MovieData() md1.title = "Star Wars" md1.year = 1989 md1.director = "George Lucas" lib.add_movie(md1) md2 = MovieData() md2.title = "Forrest Gump" md2.year = 1999 md2.director = "Pedro Lopez" lib.add_movie(md2) lib.calc_time_span() p.body = lib.compile_list() + lib.calc_time_span() self.response.write(p.print_out())
def get(self): #page for class p = Page() lib = FavoriteMovies() #lib object #movie title #year movie was made #director of film md1 = MovieData() md1.title = "The Princess Bride" md1.year = 1989 #calling a function md1.director = "Rob Reiner" lib.add_movie(md1) md2 = MovieData() md2.title = "Dune" md2.year = 1986 #calling a function md2.director = "David Lynch" lib.add_movie(md2) md2 = MovieData() md2.title = "Star Wars" md2.year = 1977 #calling a function md2.director = "George Lucas" lib.add_movie(md2) p.body = lib.compile_list() + lib.calc_time_span() #lib.movie_list = [md1, md2] = if it was public self.response.write(p.print_out())
def get(self): p = Page() p.title ="My page" p.css ="css/styles.css" p.body = "Miss Piggy like Kermit De Frog" self.response.write(p.whole_page)
def get(self): p = Page() p.title = 'My Page!' p.css = 'css/main.css' p.body = "Miss Piggy is aweful!" p.update() self.response.write(p.whole_page)
def get(self): p = Page() p.title = "My Page" p.css = "/css/style.css" p.body = "Changer" p.update() self.response.write(p.whole_page)
def get(self): p = Page() p.title = "My page!" #Setter was created so we could change p.css = "css/style.css" p.body = "Miss Piggy likes Kermit de Frog!" p.update() self.response.write(p.whole_page)
def get(self): #self.response.write('Hello world!') p = Page() p.title = "My Page" p.css = "css/style.css" p.body = "This is Stacy's Python Example" #self.response.write(p.print_out()) p.update() self.response.write(p.whole_page)
def get(self): p = Page() p.title = "My page!" p.css = "css/style.css" p.body = "Miss Piggy likes Kermit de Frog" #this will replace the body text below in self.body #print p.print_out()#this will print out in the google engine console #self.response.write(p.print_out())# this will print out in browser (removed for getter/setter example) # p.update() #replacing the above #self.response...... #let's remove p.update() from here and add to main.py to have it auto update whenever data changes; it won't be p.update it will be self.update over there self.response.write(p.whole_page)
def get(self): p = Page() lib = FavoriteMovies() md1 = MovieData() md1.title = "The Princess Bride" md1.year = 1989 # actually calling a function md1.director = "Rob Reiner" lib.add_movie(md1) md2 = MovieData() md2.title = "Dune" md2.year = 1986 md2.director = "David Lynch" lib.add_movie(md2) md3 = MovieData() md3.title = "Star Wars" md3.year = 1977 md3.director = "George Lucus" lib.add_movie(md3) p.body = lib.compile_list() + lib.calc_time_span() self.response.write(p.print_out())
def get(self): p = Page() p.title = "My page!" p.css = "css/styles.css" p.body ="Miss Piggy likes Chocolate!" #modify's self.body self.response.write(p.whole_page)
def get(self): p = Page() p.body = "Update" self.response.write(p.print_out())
def get(self): p = Page() p.body = "Miss Piggy like Kermit De Frog" self.response.write(p.print_out())
def get(self): #self.response.write('Hello world!') p = Page() p.body = "This is Stacys Python Example" self.response.write(p.print_out())
def get(self): p = Page() p.title = "My page!" p.css = "css/style.css" p.body = "Hello World" self.response.write(p.whole_page)
def get(self): p = Page() p.title = "My Page" p.body = "Miss Piggy likes Kermit De Frog!" self.response.write(p.whole_page)
def get(self): p = Page() p.body = "Miss Piggy likes Kermit de Frog" #this will replace the body text below in self.body #print p.print_out()#this will print out in the google engine console self.response.write(p.print_out())# this will print out in browser
def get(self): p = Page() p.body = "Hello World" self.response.write(p.print_out())
def get(self): p = Page() p.title = "My Page!" p.css = "css/style.css" p.body = "Apples!" self.response.write(p.whole_page)
def get(self): p = Page() p.body = "Hello!" p.title = "My Page!!!!!" p.css = "css/main.css" self.response.write(p.whole_page)
def get(self): p = Page() p.body = 'Miss Piggy likes Kermit de Frog' self.response.write(p.print_out())
def get(self): p = Page() p.body = "Miss Piggy like Kermit De Frog!" self.response.write(p.print_out())
def get(self): #Membership Data Information #Charles Registration c = Registration() c.name = "Charles" c.address = "124 Main Street, Chambersburg, PA 17201" c.phone = "717-555-9545" c.level = "Professional" c.horses = 5 c.fee = 125.95 c.calc_price() #self.response.write ("<strong>Name:</strong> " + c.name + "<br /><strong>Address:</strong> " + c.address + "<br /><strong>Phone:</strong> " + c.phone + "<br /><strong>Membership Level:</strong> " + c.level + "<br /><strong>Number of Horses Registered:</strong> " + str(c.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(c.final_price)) #Megan Registration m = Registration() m.name = "Megan" m.address = "567 Second Street, Chambersburg, PA 17201" m.phone = "717-555-9545" m.level = "Youth" m.horses = 15 m.fee = 25.95 m.calc_price() #self.response.write ("<br><br><strong>Name:</strong> " + m.name + "<br /><strong>Address:</strong> " + m.address + "<br /><strong>Phone:</strong> " + m.phone + "<br /><strong>Membership Level:</strong> " + m.level + "<br /><strong>Number of Horses Registered:</strong> " + str(m.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(m.final_price)) #Duke Registration d = Registration() d.name = "Duke" d.address = "2905 Roland Avenue, Chambersburg, PA 17201" d.phone = "555-234-6789" d.level = "Amatuer" d.horses = 1 d.fee = 75.95 d.calc_price() #self.response.write ("<br><br><strong>Name:</strong> " + d.name + "<br /><strong>Address:</strong> " + d.address + "<br /><strong>Phone:</strong> " + d.phone + "<br /><strong>Membership Level:</strong> " + d.level + "<br /><strong>Number of Horses Registered:</strong> " + str(d.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(d.final_price)) #Jenn Registration j = Registration() j.name = "Jennifer" j.address = "9012 Norland Avenue, Chambersburg, PA 17201" j.phone = "555-573-9753" j.level = "Youth" j.horses = 5 j.fee = 25.95 j.calc_price() #self.response.write ("<br><br><strong>Name:</strong> " + j.name + "<br /><strong>Address:</strong> " + j.address + "<br /><strong>Phone:</strong> " + j.phone + "<br /><strong>Membership Level:</strong> " + j.level + "<br /><strong>Number of Horses Registered:</strong> " + str(j.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(j.final_price)) #Tara's Registration t = Registration() t.name = "Tara" t.address = "1242 Livermoore Road, Chambersburg, PA 17201" t.phone = "555-234-9874" t.level = "Professional" t.horses = 15 t.fee = 125.95 t.calc_price() #self.response.write ("<br><br><strong>Name:</strong> " + t.name + "<br /><strong>Address:</strong> " + t.address + "<br /><strong>Phone:</strong> " + t.phone + "<br /><strong>Membership Level:</strong> " + t.level + "<br /><strong>Number of Horses Registered:</strong> " + str(t.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(t.final_price)) p = Page() #p.body = "<strong>Name:</strong> " + c.name + "<br /><strong>Address:</strong> " + c.address + "<br /><strong>Phone:</strong> " + c.phone + "<br /><strong>Membership Level:</strong> " + c.level + "<br /><strong>Number of Horses Registered:</strong> " + str(c.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(c.final_price) + "<br/><hr><strong>Name:</strong> " + m.name + "<br /><strong>Address:</strong> " + m.address + "<br /><strong>Phone:</strong> " + m.phone + "<br /><strong>Membership Level:</strong> " + m.level + "<br /><strong>Number of Horses Registered:</strong> " + str(m.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(m.final_price) + "<br/><hr><strong>Name:</strong> " + d.name + "<br /><strong>Address:</strong> " + d.address + "<br /><strong>Phone:</strong> " + d.phone + "<br /><strong>Membership Level:</strong> " + m.level + "<br /><strong>Number of Horses Registered:</strong> " + str(d.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(d.final_price) + "<br/><hr><strong>Name:</strong> " + j.name + "<br /><strong>Address:</strong> " + j.address + "<br /><strong>Phone:</strong> " + j.phone + "<br /><strong>Membership Level:</strong> " + j.level + "<br /><strong>Number of Horses Registered:</strong> " + str(j.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(j.final_price) + "<br/><hr><strong>Name:</strong> " + t.name + "<br /><strong>Address:</strong> " + t.address + "<br /><strong>Phone:</strong> " + t.phone + "<br /><strong>Membership Level:</strong> " + t.level + "<br /><strong>Number of Horses Registered:</strong> " + str(t.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(t.final_price) p.body = "<h1>Registered Members</h1><a href='?name="+ c.name +"'>" + c.name + "</a><br>" + "<a href='?name="+ m.name +"'>" + m.name + "</a><br>" + "<a href='?name="+ d.name +"'>" + d.name + "</a><br>" + "<a href='?name="+ j.name +"'>" + j.name + "</a><br>" + "<a href='?name="+ t.name +"'>" + t.name + "</a><br>" # When link is click and there is variables this following is viewed if self.request.GET: name = self.request.GET['name'] # if variable = Charles if name == "Charles": address = c.address phone = c.phone level = c.level horses = c.horses fee = c.fee _final_price = m.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration Fee:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) # if variable = Megan if name == "Megan": address = m.address phone = m.phone level = m.level horses = m.horses fee = m.fee _final_price = m.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration Fee:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) # if variable = Duke if name == "Duke": address = d.address phone = d.phone level = d.level horses = d.horses fee = d.fee _final_price = d.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) # if variable = Jennifer if name == "Jennifer": address = j.address phone = j.phone level = j.level horses = j.horses fee = j.fee _final_price = j.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) # if variable = Tara if name == "Tara": address = t.address phone = t.phone level = t.level horses = t.horses fee = t.fee _final_price = t.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) else: # if no variables then nothing is viewed p.view = '' self.response.write(p.print_out())
def get(self): p = Page() #instance of page p.body = "Miss Piggy Likes Kermit De Frog!" self.response.write(p.print_out()) #prints out to browser
def get(self): p = Page() p.title = "my page" p.body = "Miss piggy likes Kermit the Frog" p.update() self.response.write(p.whole_page)
def get(self): p = Page() p.body = "Miss Piggy is aweful!" self.response.write(p.print_out())
def get(self): p = Page() p.body ="Miss Piggy likes Chocolate!" #modify's self.body self.response.write(p.print_out())