def RenderApartmentsTable(self):
        table = QTableView(self)
        table.setMaximumWidth(500)
        table.setEditTriggers(QAbstractItemView.NoEditTriggers)
        table.setSelectionBehavior(QAbstractItemView.SelectRows)
        table.setSelectionMode(QAbstractItemView.SingleSelection)
        table.clicked.connect(self.RowSelected)

        apartments = Apartment_service()
        self.apartment_data = apartments.apartments_list()
        self.model = ApartmentsTableModel(self.apartment_data, apartments)
        table.setModel(self.model)

        return table
Example #2
0
 def apartment_count(self):
     apartments = Apartment_service()
     count = len(apartments.apartments_list())
     return str(count)