예제 #1
0
파일: main.py 프로젝트: ericgrogers/DPW
    def get(self):
        #create a shortcut to the Page() class
        p = Page()

        #if the GET method is invoked, grab the form values and set them to the proper keys
        if self.request.GET:

            #create a shortcut for self.request
            sr = self.request

            #set the page title.
            p.title = "Eric Rogers | Thank You!"

            #set the Page().name attribute to the input value submitted.
            p.name = sr.GET['name']

            #set the Page().telephone attribute to the input value submitted.
            p.telephone = sr.GET['telephone']

            #set the Page().email attribute to the input value submitted.
            p.email = sr.GET['email']

            #set the Page().interest attribute to the input value submitted.
            p.interest = sr.GET['interest']

            #set the Page().return_customer attribute to reflect the user's choice when checked.
            p.return_customer = 'Yes, please give me a 10% discount.'

            #try to grab the Page().return_customer checkbox value
            try:
                sr.GET['return_customer']

            #if there is no value, the server throws a KeyError meaning the box is not checked.
            except KeyError:

                #set the Page().return_customer attribute to reflect the user's choice when not checked.
                p.return_customer = 'No, I am a new customer.'

            #output Page().view2 to the page.
            self.response.write(p.view2())

        #otherwise, output Page().view1 to the page.
        else:
            self.response.write(p.view1())
예제 #2
0
파일: main.py 프로젝트: LittlefieldBous/DP
    def get(self):  #indent here. This function starts everything. below is html5 within the python there is a page head, body and close definied by '''.
        p = Page() #I want to make an instance
        p.format_all()
        if self.request.GET: #has to be in handler
            #stores info we got from the form

            f_name = self.request.GET['f_name']  #needs variables to work
            l_name = self.request.GET['l_name']  #needs variables to work
            address = self.request.GET['address']
            state = self.request.GET['state']
            zip = self.request.GET['zip']
            email = self.request.GET['email']
            p.email = email
            content = self.request.GET['content']
            #terms = self.request.GET['terms']
            #dropdown = self.request.GET['terms']
            self.response.write(p.head + ' ' + p.body + "<div id='wrapper'>"+ "<h3>" "Congratulations on becoming a member of Veronica Vineyards!" + "</h3>" + ' ' + "<div id='name'>" + f_name + ' ' + l_name + "</div>" + "<div id='contact'>" + address + "</div>" + "<div id='state_zip'>" + ' ' + state + ' ' + zip + "</div>" + ' ' + "</br>" + "Look for your email confirmation at:" + ' ' + email + ' ' + "If errors occurred or you would like to update your address please contact us at [email protected]" + "</div>" + p.close)  #this is what I want printed whe returned...I'm not sure how to do the css for this?
        else:
            self.response.write(p.head + p.body + p.close) #prints the information on the page