当前位置: 首页>>代码示例>>Python>>正文


Python searchfilters.ComboSearchFilter类代码示例

本文整理汇总了Python中stoqlib.gui.search.searchfilters.ComboSearchFilter的典型用法代码示例。如果您正苦于以下问题:Python ComboSearchFilter类的具体用法?Python ComboSearchFilter怎么用?Python ComboSearchFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ComboSearchFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_filters

    def create_filters(self):
        items = [(_("Active"), True), (_("Inactive"), False)]
        items.insert(0, (_("Any"), None))

        status_filter = ComboSearchFilter(_("Show transporters with status"), items)
        status_filter.select(None)
        self.add_filter(status_filter, SearchFilterPosition.TOP, ["is_active"])
开发者ID:coletivoEITA,项目名称:stoq,代码行数:7,代码来源:personsearch.py

示例2: create_filters

 def create_filters(self):
     # status filter
     statuses = [(desc, i) for i, desc in Loan.statuses.items()]
     statuses.insert(0, (_(u'Any'), None))
     status_filter = ComboSearchFilter(_(u'with status:'), statuses)
     status_filter.select(None)
     self.add_filter(status_filter, columns=['loan_status'],
                     position=SearchFilterPosition.TOP)
开发者ID:hackedbellini,项目名称:stoq,代码行数:8,代码来源:loansearch.py

示例3: create_filters

 def create_filters(self):
     self.set_text_field_columns(['description', 'identifier_str'])
     # status filter
     statuses = [(desc, i) for i, desc in Loan.statuses.items()]
     statuses.insert(0, (_(u'Any'), None))
     status_filter = ComboSearchFilter(_(u'with status:'), statuses)
     status_filter.select(None)
     self.add_filter(status_filter, columns=['loan_status'],
                     position=SearchFilterPosition.TOP)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:9,代码来源:loansearch.py

示例4: create_filters

 def create_filters(self):
     self.set_text_field_columns(['description', 'barcode'])
     items = [(v, k) for k, v in Sellable.statuses.items()]
     items.insert(0, (_('Any'), None))
     service_filter = ComboSearchFilter(_('Show services'),
                                        items)
     service_filter.select(None)
     self.executer.add_query_callback(self._get_query)
     self.add_filter(service_filter, SearchFilterPosition.TOP, ['status'])
开发者ID:tmaxter,项目名称:stoq,代码行数:9,代码来源:servicesearch.py

示例5: create_filters

 def create_filters(self):
     self.set_text_field_columns(['name', 'cpf', 'rg_number',
                                  'phone_number', 'mobile_number'])
     statuses = [(v, k) for k, v in Client.statuses.items()]
     statuses.insert(0, (_('Any'), None))
     status_filter = ComboSearchFilter(_('Show clients with status'),
                                       statuses)
     status_filter.select(None)
     self.add_filter(status_filter, SearchFilterPosition.TOP, ['status'])
开发者ID:LeonamSilva,项目名称:stoq,代码行数:9,代码来源:personsearch.py

示例6: DeliverySearch

class DeliverySearch(SearchEditor):
    """Delivery search implementation"""

    title = _('Delivery Search')
    search_spec = DeliveryView
    editor_class = DeliveryEditor
    has_new_button = False
    size = (750, 450)

    #
    #  SearchEditor hooks
    #

    def _get_status_values(self):
        items = [(value, key) for key, value in Delivery.statuses.items()]
        items.insert(0, (_('Any'), None))
        return items

    def create_filters(self):
        self.set_text_field_columns(['tracking_code', 'transporter_name',
                                     'client_name', 'identifier_str'])

        # Status
        statuses = [(desc, st) for st, desc in Delivery.statuses.items()]
        statuses.insert(0, (_('Any'), None))
        self.status_filter = ComboSearchFilter(_('With status:'), statuses)
        self.status_filter.select(None)
        self.add_filter(self.status_filter, columns=['status'],
                        position=SearchFilterPosition.TOP)

    def get_editor_model(self, viewable):
        return viewable.delivery

    def get_columns(self):
        return [IdentifierColumn('sale_identifier', title=_('Sale #'),
                                 order=gtk.SORT_DESCENDING),
                SearchColumn('status_str', title=_('Status'), data_type=str,
                             search_attribute='status',
                             valid_values=self._get_status_values()),
                Column('address_str', title=_('Address'), data_type=str,
                       expand=True, ellipsize=pango.ELLIPSIZE_END),
                SearchColumn('tracking_code', title=_('Tracking code'),
                             data_type=str),
                SearchColumn('transporter_name', title=_('Transporter'),
                             data_type=str),
                SearchColumn('client_name', title=_('Client'),
                             data_type=str),
                SearchColumn('open_date', title=_('Open date'),
                             data_type=datetime.date, visible=False),
                SearchColumn('deliver_date', title=_('Sent date'),
                             data_type=datetime.date, visible=False),
                SearchColumn('receive_date', title=_('Received date'),
                             data_type=datetime.date, visible=False),
                ]
开发者ID:Guillon88,项目名称:stoq,代码行数:54,代码来源:deliverysearch.py

示例7: create_filters

 def create_filters(self):
     self.set_text_field_columns(['name', 'acronym', 'phone_number'])
     statuses = [(value, key)
                 for key, value in Branch.statuses.items()]
     statuses.insert(0, (_('Any'), None))
     status_filter = ComboSearchFilter(_('Show branches with status'),
                                       statuses)
     status_filter.select(None)
     self.executer.add_filter_query_callback(
         status_filter, self._get_status_query)
     self.search.add_filter(status_filter, SearchFilterPosition.TOP)
开发者ID:tmaxter,项目名称:stoq,代码行数:11,代码来源:personsearch.py

示例8: create_sellable_filter

    def create_sellable_filter(self, label=None):
        from stoqlib.domain.sellable import Sellable
        items = [(desc, status) for status, desc in Sellable.statuses.items()]
        items.insert(0, (_(u"Any"), None))

        if label is None:
            label = _('With status:')
        sellable_filter = ComboSearchFilter(label, items)
        # Select status available by default
        sellable_filter.select(Sellable.STATUS_AVAILABLE)

        return sellable_filter
开发者ID:Guillon88,项目名称:stoq,代码行数:12,代码来源:searchdialog.py

示例9: create_filters

    def create_filters(self):
        self.set_text_field_columns(['description'])
        self.executer.add_query_callback(self._get_query)

        # Status
        items = [(v, k) for k, v in Till.statuses.items()
                 if k != Till.STATUS_PENDING]
        items.insert(0, (_(u'Any'), None))
        status_filter = ComboSearchFilter(_(u'Show entries of type'), items)
        status_filter.select(Till.STATUS_OPEN)
        self.add_filter(status_filter,
                        position=SearchFilterPosition.TOP,
                        columns=['status'])
开发者ID:tmaxter,项目名称:stoq,代码行数:13,代码来源:tillsearch.py

示例10: create_payment_filter

    def create_payment_filter(self, label=None):
        from stoqlib.domain.payment.method import PaymentMethod
        methods = PaymentMethod.get_active_methods(self.store)
        items = [(_('Any'), None)]
        for method in methods:
            if method.method_name == 'multiple':
                continue
            items.append((method.description, method))

        if not label:
            label = _('Method:')
        payment_filter = ComboSearchFilter(label, items)
        payment_filter.select(None)

        return payment_filter
开发者ID:leandrorchaves,项目名称:stoq,代码行数:15,代码来源:searchdialog.py

示例11: create_branch_filter

    def create_branch_filter(self, label=None):
        from stoqlib.domain.person import Branch

        branches = Branch.get_active_branches(self.store)
        items = [(b.get_description(), b.id) for b in branches]
        items.insert(0, (_("Any"), None))

        if not label:
            label = _("Branch:")
        branch_filter = ComboSearchFilter(label, items)
        current = api.get_current_branch(self.store)
        if current:
            branch_filter.select(current.id)

        return branch_filter
开发者ID:rg3915,项目名称:stoq,代码行数:15,代码来源:searchdialog.py

示例12: create_filters

 def create_filters(self):
     self.search.set_query(self._query)
     self.set_text_field_columns(["description", "code", "barcode", "category_description", "manufacturer"])
     branches = Branch.get_active_branches(self.store)
     self.branch_filter = ComboSearchFilter(_("Show by:"), api.for_combo(branches, empty=_("All branches")))
     self.branch_filter.select(api.get_current_branch(self.store))
     self.add_filter(self.branch_filter, position=SearchFilterPosition.TOP)
开发者ID:coletivoEITA,项目名称:stoq,代码行数:7,代码来源:stock.py

示例13: create_filters

 def create_filters(self):
     self.set_text_field_columns(['supplier_name', 'identifier_str',
                                  'invoice_numbers'])
     self.status_filter = ComboSearchFilter(_('Show orders'),
                                            self._get_status_values())
     self.add_filter(self.status_filter, SearchFilterPosition.TOP, ['status'])
     self.branch_filter = self.create_branch_filter(column=PurchaseOrderView.branch_id)
开发者ID:hackedbellini,项目名称:stoq,代码行数:7,代码来源:purchase.py

示例14: create_filters

 def create_filters(self):
     statuses = [(desc, i) for i, desc in ProductionOrder.statuses.items()]
     statuses.insert(0, (_(u'Any'), None))
     self.status_filter = ComboSearchFilter(_('order status:'), statuses)
     self.status_filter.select(ProductionOrder.ORDER_PRODUCING)
     self.add_filter(self.status_filter, columns=['order_status'],
                     position=SearchFilterPosition.TOP)
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:7,代码来源:productionsearch.py

示例15: create_filters

 def create_filters(self):
     self.executer.set_query(self._query)
     self.set_text_field_columns(['description'])
     self.branch_filter = ComboSearchFilter(
         _('Show by:'), self._get_branches())
     self.branch_filter.select(api.get_current_branch(self.store))
     self.add_filter(self.branch_filter, position=SearchFilterPosition.TOP)
开发者ID:tmaxter,项目名称:stoq,代码行数:7,代码来源:stock.py


注:本文中的stoqlib.gui.search.searchfilters.ComboSearchFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。