def getHouseholds(self):
     controller = Controller()
     project = controller.getProject( self.parent.projectid )
     households = project.getHouseholds()
     
     for household in households:
         hhid = household.getHouseholdID()
         householdname = household.getHouseholdName()
         self.cboHouseholdName.addItem(householdname, QVariant(hhid))
Beispiel #2
0
 def saveHousehold(self):
     ''' Saves newly created household data to database '''
 
     # get the data entered by user
     hhid                = self.txtShortHouseHoldName.text()
     householdname = self.txtHouseholdName.text()
     dateofcollection       = self.dtpDateVisted.date().toString("yyyy-MM-dd")
     pid              = self.parent.projectid
     
     # save household
     controller = Controller()
     project = controller.getProject( pid )
     project.addHousehold( hhid,  householdname,  dateofcollection)
     
     # close new project window
     self.parent.mdi.closeActiveSubWindow()
 def __init__(self, parent,  hhid):
     ''' Set up the dialog box interface '''
     QDialog.__init__(self)
     self.setupUi(self)
     self.parent = parent
     self.hhid = hhid
     
     # get current project details
     controller = Controller()
     project  = controller.getProject( self.parent.projectid )
     self.household = project.getHousehold( self.hhid )
     self.showHouseholdDetails()
     
     # allow the calendar widget to pop up
     self.dtpDateVisted.setCalendarPopup(True)
     
     # display project name
     self.lblProjectName.setText(self.parent.projectname)