當前位置: 首頁>>代碼示例>>Python>>正文


Python SellableCategory.get_base_categories方法代碼示例

本文整理匯總了Python中stoqlib.domain.sellable.SellableCategory.get_base_categories方法的典型用法代碼示例。如果您正苦於以下問題:Python SellableCategory.get_base_categories方法的具體用法?Python SellableCategory.get_base_categories怎麽用?Python SellableCategory.get_base_categories使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在stoqlib.domain.sellable.SellableCategory的用法示例。


在下文中一共展示了SellableCategory.get_base_categories方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_get_base_categories

# 需要導入模塊: from stoqlib.domain.sellable import SellableCategory [as 別名]
# 或者: from stoqlib.domain.sellable.SellableCategory import get_base_categories [as 別名]
 def test_get_base_categories(self):
     categories = SellableCategory.get_base_categories(self.store)
     count = categories.count()
     base_category = SellableCategory(description=u"Monitor",
                                      store=self.store)
     category = SellableCategory(description=u"LCD Monitor",
                                 category=base_category,
                                 store=self.store)
     categories = SellableCategory.get_base_categories(self.store)
     self.failUnless(base_category in categories)
     self.failIf(category in categories)
     self.assertEqual(categories.count(), count + 1)
開發者ID:LeonamSilva,項目名稱:stoq,代碼行數:14,代碼來源:test_sellable.py

示例2: _setup_widgets

# 需要導入模塊: from stoqlib.domain.sellable import SellableCategory [as 別名]
# 或者: from stoqlib.domain.sellable.SellableCategory import get_base_categories [as 別名]
    def _setup_widgets(self):
        # open inventory button
        self.main_dialog.ok_button.set_label(_(u"_Open"))
        # select all the branches that are able to open an inventory
        branches = []
        for branch in self._branches:
            branches.append((branch.person.name, branch))
        self.branch_combo.prefill(branches)
        self.branch_combo.select(branches[0][1])

        self.username.set_text(self.model.user.person.name)
        self.open_time.set_text(self.model.open_date.strftime("%X"))
        # load categories
        self.category_tree.set_columns(self._get_columns())
        for category in SellableCategory.get_base_categories(self.store):
            self._append_category(category)

        self.category_tree.connect(
            'cell-edited', self._on_category_tree__cell_edited)
開發者ID:leandrorchaves,項目名稱:stoq,代碼行數:21,代碼來源:openinventorydialog.py

示例3: _setup_widgets

# 需要導入模塊: from stoqlib.domain.sellable import SellableCategory [as 別名]
# 或者: from stoqlib.domain.sellable.SellableCategory import get_base_categories [as 別名]
    def _setup_widgets(self):
        self.product_manufacturer.prefill(
            api.for_combo(self.store.find(ProductManufacturer)))

        self.product_brand.prefill(
            [(m, m) for m in
             sorted(Product.find_distinct_values(self.store, Product.brand))])

        self.product_family.prefill(
            [(m, m) for m in
             sorted(Product.find_distinct_values(self.store, Product.family))])

        self.username.set_text(self.model.user.person.name)
        self.open_time.set_text(self.model.open_date.strftime("%X"))
        # load categories
        self.category_tree.set_columns(self._get_columns())
        for category in SellableCategory.get_base_categories(self.store):
            self._append_category(category)

        self._uncategorized_products = self._append_category(
            _UncategorizedProductsCategory())
開發者ID:EasyDevSolutions,項目名稱:stoq,代碼行數:23,代碼來源:inventoryeditor.py


注:本文中的stoqlib.domain.sellable.SellableCategory.get_base_categories方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。