Esempio n. 1
0
    def get(self):

        # create our form page
        f = Form()
        # create the results view
        rp = ResultsPage()

        # GET Method to grab variables from user input
        if self.request.GET:
            # storing our info from the user inputs
            # call our BudgetBreak Object
            user = BudgetBreak()
            user.name = self.request.GET["name"]
            user.email = self.request.GET["email"]
            user.mon_exp = int(self.request.GET["monExp"])
            user.mon_income = int(self.request.GET["monIncome"])
            user.have_budget = self.request.GET["budget"]

            # RESULTS PAGE - INFORMATION
            # Print out if form has been submitted otherwise print out following else:
            rp.email = user.email  # setting for print out of HTML elements on pages.py
            rp.annual = user.annual()
            rp.discretion = user.discretion()
            rp.name = user.name
            rp.mon_income = user.mon_income
            rp.mon_exp = user.mon_exp
            rp.calc_mortgage = user.calc_mortgage()
            # WOOOHOOOOOOO

            self.response.write(rp.print_out())
        else:
            self.response.write(f.print_out())  # this will print out in browser
Esempio n. 2
0
    def get(self):

        #create our form page
    	f = Form()
    	#create the results view
    	rp = ResultsPage()       
        
    	#GET Method to grab variables from user input
        if self.request.GET:
            #storing our info from the user inputs
            #call our BudgetBreak Object
            user = BudgetBreak()
            user.name = self.request.GET['name']
            user.email = self.request.GET['email']
            user.mon_exp = int(self.request.GET['monExp'])  
            user.mon_income = int(self.request.GET['monIncome'])        
            user.have_budget = self.request.GET['budget']

            #RESULTS PAGE - INFORMATION 
            #Print out if form has been submitted otherwise print out following else:
            self.response.write(rp.print_out() + '<h3>Greetings, ' +  user.name + '!</h3>' +  'From the information provided we have calculated the following information.<br/>' + 'Your email is: ' + user.email + '</p>' + 'The total of your recurring monthly expenses is: ' + str(user.mon_exp) + '<br />' + ' Your total monthly income is: ' + str(user.mon_income) + '<br />' + 'Your total monthly discretionary funds comes to ' + str(user.discretion()) + '<br />' +  'You ' + user.have_budget + ' use a budget to track your expenses and income.' + '<br />' +'Your estimated mortgage allowance should be ' + str(user.calc_mortgage()) + '<br />' + 'Your annual income is: ' + str(user.annual()))
        else:           
        	self.response.write(f.print_out())# this will print out in browser