Exemple #1
0
        def get(self):

            #attributes
            #1.Sunflower Variety/brand -brand
            #2.Sunflower Height per inches - height
            #3.Sunflower Population per acre -population
            #4.Sunflower Yield Pounds/lbs per acre - lbs
            #5.Crop Harvest Year - year

            sd1 = SunflowerData()
            sd1.brand = ''       # creating attributes here...
            sd1.height =  ''
            sd1.population = ''
            sd1.pounds = ''
            #calling a function
            #sd1.year = 2014
            #lib.add_sunflower(sd1)

            p = ResultsPage() #I want to make an instance
            lib = Sunflowers()
            p.format_all()
            lib.calc_profit()

            if self.request.GET: #has to be in handler
            #stores info we got from the form

                brand = self.request.GET['brand']  #needs variables to work
                height = self.request.GET['height']  #needs variables to work
                population = self.request.GET['population']
                pounds = self.request.GET['pounds']
                year = self.request.GET['year']
            else:
                self.response.write(p.body + "<div id='wrapper'>"+ "<h3>" "Sunflower Varieties Profit Calculator" + "</h3>" + ' ' + "<div id='name'>" + "Sunflower Variety/Brand:" + brand + "</div>" + "<div id='height2'>" + "Sunflower Height:" + height + "</div>" + "<div id='population2'>" + "Population per Acre:" + ' ' + population + "</div>" + "<div id='pounds2'>" + "Pounds per Acre:" + pounds + ' ' + "<div id='year2'>" + year + "</div>" "</br>"  +  "</div>" + p.close)
             #this is what I want printed whe repturned...I'm not sure how to do the css for this?
            self.response.write(p.head + p.body + p.close)   #prints the information on the page