def setup_station_combo(self): if self._branch_station: self.station.prefill([(self._branch_station.name, self._branch_station)]) self.model.station = self._branch_station return self.station.prefill( [(station.name, station) for station in BranchStation.get_active_stations(self.store)])
def setup_station_combo(self): if self._branch_station: self.station.prefill([(self._branch_station.name, self._branch_station)]) self.model.station = self._branch_station return self.station.prefill( [(station.name, station) for station in BranchStation.get_active_stations(self.store)])
def setup_proxies(self): stations = BranchStation.get_active_stations(self.store) self.station.prefill([(station.name, station) for station in stations]) layouts = self.store.find(InvoiceLayout) self.layout.prefill([(layout.get_description(), layout) for layout in layouts.order_by(InvoiceLayout.description)]) self.proxy = self.add_proxy(self.model, InvoicePrinterEditor.proxy_widgets)
def setup_proxies(self): stations = BranchStation.get_active_stations(self.store) self.station.prefill([(station.name, station) for station in stations]) layouts = self.store.find(InvoiceLayout) self.layout.prefill([(layout.get_description(), layout) for layout in layouts.order_by(InvoiceLayout.description)]) self.proxy = self.add_proxy(self.model, InvoicePrinterEditor.proxy_widgets)
def test_get_active_stations(self): active = self.store.find(BranchStation, is_active=True).order_by( BranchStation.name) self.assertEquals(set(BranchStation.get_active_stations(self.store)), set(active))
def test_get_active_stations(self): active = self.store.find(BranchStation, is_active=True).order_by(BranchStation.name) self.assertEqual(set(BranchStation.get_active_stations(self.store)), set(active))