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


Python ComboSearchFilter.select方法代码示例

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


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

示例1: create_filters

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
    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,代码行数:9,代码来源:personsearch.py

示例2: create_filters

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
 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,代码行数:10,代码来源:loansearch.py

示例3: create_filters

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
 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,代码行数:11,代码来源:loansearch.py

示例4: create_filters

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
 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,代码行数:11,代码来源:servicesearch.py

示例5: create_filters

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
 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,代码行数:11,代码来源:personsearch.py

示例6: DeliverySearch

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
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,代码行数:56,代码来源:deliverysearch.py

示例7: create_filters

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
 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,代码行数:13,代码来源:personsearch.py

示例8: create_sellable_filter

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
    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,代码行数:14,代码来源:searchdialog.py

示例9: create_filters

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
    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,代码行数:15,代码来源:tillsearch.py

示例10: create_payment_filter

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
    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,代码行数:17,代码来源:searchdialog.py

示例11: create_branch_filter

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
    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,代码行数:17,代码来源:searchdialog.py

示例12: create_branch_filter

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
    def create_branch_filter(self, label=None):
        from stoqlib.domain.person import Branch
        current = api.get_current_branch(self.store)
        if api.sysparam.get_bool('SYNCHRONIZED_MODE'):
            items = [(current.get_description(), current.id)]
        else:
            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)
        if current:
            branch_filter.select(current.id)

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

示例13: create_branch_filter

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
    def create_branch_filter(self, label=None):
        from stoqlib.domain.person import Branch
        branches = Branch.get_active_branches(self.store)
        items = [(b.person.name, b.id) for b in branches]
        # if not items:
        #    raise ValueError('You should have at least one branch at '
        #                      'this point')
        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:leandrorchaves,项目名称:stoq,代码行数:19,代码来源:searchdialog.py

示例14: create_filters

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
    def create_filters(self):
        self.set_text_field_columns(['description', 'barcode',
                                     'category_description'])
        self.search.set_query(self.executer_query)

        # Branch
        branch_filter = self.create_branch_filter(_('In branch:'))
        self.add_filter(branch_filter, columns=[])
        self.branch_filter = branch_filter

        # Status
        statuses = [(desc, id) for id, desc in Sellable.statuses.items()]
        statuses.insert(0, (_('Any'), None))
        status_filter = ComboSearchFilter(_('with status:'), statuses)
        status_filter.select(None)
        self.add_filter(status_filter, columns=['status'],
                        position=SearchFilterPosition.TOP)
        self.status_filter = status_filter
开发者ID:leandrorchaves,项目名称:stoq,代码行数:20,代码来源:productsearch.py

示例15: ProductionItemsSearch

# 需要导入模块: from stoqlib.gui.search.searchfilters import ComboSearchFilter [as 别名]
# 或者: from stoqlib.gui.search.searchfilters.ComboSearchFilter import select [as 别名]
class ProductionItemsSearch(SearchDialog):
    title = _(u'Production Items')
    search_table = ProductionItemView
    size = (750, 450)

    #
    # SearchDialog
    #

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

        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)

    def get_columns(self):
        return [IdentifierColumn('order_identifier', title=_(u"Order #"),
                                 sorted=True),
                SearchColumn('category_description', title=_(u'Category'),
                             data_type=str),
                SearchColumn('description', title=_(u'Description'),
                             data_type=str, expand=True),
                SearchColumn('unit_description', title=_(u'Unit'),
                             data_type=str),
                SearchColumn('quantity', title=_(u'To Produce'),
                             data_type=Decimal),
                SearchColumn('produced', title=_(u'Produced'),
                             data_type=Decimal),
                SearchColumn('lost', title=_(u'Lost'), data_type=Decimal,
                             visible=False)]

    #
    # Callbacks
    #

    def on_print_button_clicked(self, widget):
        print_report(ProductionItemReport, self.results, list(self.results),
                     filters=self.search.get_search_filters(), )
开发者ID:tmaxter,项目名称:stoq,代码行数:44,代码来源:productionsearch.py


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