Пример #1
0
    def getReportTable (self):

        pid = self.getProjectID()
        reporttype = self.setReportType()
        reportQuery =self.getFinalReportTableQuery()
        connector = HouseholdIncome()
        reportTable = connector.getReportTable(reportQuery,pid,reporttype)
        return reportTable
Пример #2
0
    def getHouseholdIDsQuery(self):
        '''Get query for generating a list of households that match a users selection criteria'''

        projectid = self.getProjectID()
        selectedHChars = self.getSelectedHouseholdCharacteristics()
        selectedPChars = self.getSelectedPersonalCharacteristics()
        selectedhouseholds = self.getHouseholdsSelection()
        connector = HouseholdIncome()
        householdIDsQuery = connector.buildReportHouseholdIDsQuery(projectid,selectedhouseholds,selectedPChars,selectedHChars)
        return householdIDsQuery
Пример #3
0
 def getReportHouseholdIDs (self):
     '''Get a list of households that match a users selection criteria -i.e Household names + Personal Characteristics and Household Characteristics'''
     
     selectedids = []
     householdIDsQuery =self.getHouseholdIDsQuery()
     connector = HouseholdIncome()
     householdIDs = connector.getReportHouseholdIDs(householdIDsQuery)
     for hid in householdIDs:
         selectedids.append(str(hid[0]))
     return selectedids
Пример #4
0
    def getFinalReportTableQuery(self):

        projectid = self.getProjectID()
        householdIDs = self.getDISortedHouseholdIDs()
        cropdetails = self.getCropReportDetails()
        employmentdetails = self.getEmploymentReportDetails()
        livestockdetails = self.getLivestockReportDetails()
        loandetails = self.getLoansReportDetails()
        transferdetails = self.getTransfersDetails()
        wildfoodsdetails = self.getWildFoodDetails()
        reporttype = self.setReportType()
        
        connector = HouseholdIncome()
        householdIDsQuery = connector.getFinalIncomeReportTableQuery(reporttype,projectid,householdIDs,cropdetails,employmentdetails, livestockdetails,loandetails,transferdetails,wildfoodsdetails )
        return householdIDsQuery