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


Python baseeditor.BaseEditor类代码示例

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


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

示例1: __init__

    def __init__(self, store, model=None, visual_mode=False, attribute=None):
        self._attribute = attribute
        BaseEditor.__init__(self, store, model, visual_mode)
        if model:
            self.set_description(model.description)

        self.active_check_box.set_property('sensitive', bool(model))
开发者ID:hackedbellini,项目名称:stoq,代码行数:7,代码来源:grideditor.py

示例2: refresh_ok

    def refresh_ok(self, value):
        BaseEditor.refresh_ok(self, value)

        account_type = self.account_type.get_selected()
        if account_type != Account.TYPE_BANK:
            value = False
        self._test_button.set_sensitive(value)
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:accounteditor.py

示例3: __init__

    def __init__(self, wizard, parent, store, order, payment_method,
                 outstanding_value=currency(0)):
        BaseEditor.__init__(self, store, order.group)

        self._method = payment_method
        dsm = get_utility(IDomainSlaveMapper)
        slave_class = dsm.get_slave_class(self._method)
        assert slave_class

        self.store.savepoint('before_payment_creation')

        #FIXME: This is a workaround to make the slave_class to ignore the
        #       payments created previously.
        class _InnerSlaveClass(slave_class):
            def get_created_adapted_payments(self):
                return []

        self.slave = _InnerSlaveClass(wizard, parent, self.store, order,
                                      self._method, outstanding_value)
        #FIXME: We need to control how many payments could be created, since
        #       we are ignoring the payments created previously.
        payments = order.group.get_valid_payments().find(
                                        Payment.method_id == self._method.id)
        max_installments = self._method.max_installments - payments.count()
        self.slave.installments_number.set_range(1, max_installments)

        self.attach_slave('place_holder', self.slave)
开发者ID:romaia,项目名称:stoq,代码行数:27,代码来源:paymentslave.py

示例4: __init__

    def __init__(self, store, model, attr_name='notes', title=u'',
                 label_text=None, message_text=None, mandatory=False,
                 visual_mode=False):
        """
        :param store: a store
        :param model: the model that's going to have it's notes edited
        :param attr_name: the name of the attribute that contains the
            text to be edited
        :param title: if not ``None``, will be used as the dialog's title
        :param label_text: the text that will be used as a description
            for the notes' text view. If ``None``, the default "Notes"
            will be used
        :param message_label: if not ``None``, it will be used
            to display a message at the top of the dialog
        :param mandatory: if we should set the notes' text view as
            mandatory, making the dialog impossible to confirm if
            the notes are empty
        :param visual_mode: if we are working on visual mode
        """
        assert model, (u"You must supply a valid model to this editor "
                       "(%r)" % self)
        self.model_type = type(model)
        self.title = title
        self.label_text = label_text
        self.message_text = message_text
        self.mandatory = mandatory
        self.attr_name = attr_name

        # Keep this for a later rollback.
        self.original_notes = getattr(model, attr_name)

        BaseEditor.__init__(self, store, model, visual_mode=visual_mode)
        self._setup_widgets()
开发者ID:LeonamSilva,项目名称:stoq,代码行数:33,代码来源:noteeditor.py

示例5: __init__

    def __init__(self, store, model=None, role_type=None, person=None,
                 visual_mode=False, parent=None, document=None, description=None):
        """ Creates a new BasePersonRoleEditor object

        :param store: a store
        :param model:
        :param none_type: None, ROLE_INDIVIDUAL or ROLE_COMPANY
        :param person:
        :param visual_mode:
        """
        if not (model or role_type is not None):
            raise ValueError('A role_type attribute is required')
        self._description = description
        self._parent = parent
        self.individual_slave = None
        self.company_slave = None
        self._person_slave = None
        self.main_slave = None
        self.role_type = role_type
        self.person = person
        self.document = document

        BaseEditor.__init__(self, store, model, visual_mode=visual_mode)
        # FIXME: Implement and use IDescribable on the model
        self.set_description(self.model.person.name)
开发者ID:Guillon88,项目名称:stoq,代码行数:25,代码来源:persontemplate.py

示例6: __init__

 def __init__(self, store, branch=None):
     if branch is None:
         self._branch = api.get_current_branch(store)
     else:
         self._branch = branch
     BaseEditor.__init__(self, store, model=object())
     self._setup_widgets()
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:stockcostdialog.py

示例7: __init__

 def __init__(self, store, model, visual_mode=False):
     self._user = None
     self._original_price = model.price
     self._original_quantity = model.quantity
     BaseEditor.__init__(self, store, model, visual_mode=visual_mode)
     self._calc = CalculatorPopup(self.price,
                                  CalculatorPopup.MODE_SUB)
开发者ID:qman1989,项目名称:stoq,代码行数:7,代码来源:opticalwizard.py

示例8: __init__

    def __init__(self, store, model=None, visual_mode=False):
        """ Creates a new SaleDetailsDialog object

        :param store: a store
        :param model: a :class:`stoqlib.domain.sale.SaleView` object
        """
        BaseEditor.__init__(self, store, model, visual_mode=visual_mode)
开发者ID:stoq,项目名称:stoq,代码行数:7,代码来源:saledetails.py

示例9: __init__

    def __init__(self, store, model, visual_mode=False):
        self.slave_model = None
        self.edit_mode = bool(model)
        if model:
            self.slave_model = model.get_tax_model()

        BaseEditor.__init__(self, store, model, visual_mode)
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:taxclasseditor.py

示例10: __init__

    def __init__(self, store, model=None, visual_mode=False):
        BaseEditor.__init__(self, store, model, visual_mode)
        # Only let the user edit if its a new attribute
        if model:
            self.set_description(model.description)

        self.active_check_box.set_property('sensitive', bool(model))
开发者ID:amaurihamasu,项目名称:stoq,代码行数:7,代码来源:grideditor.py

示例11: __init__

    def __init__(self, store, model):
        manager = get_plugin_manager()
        self.nfe_is_active = manager.is_active('nfe')
        self.proxy = None
        self.icms_slave = None
        self.ipi_slave = None

        BaseEditor.__init__(self, store, model)
开发者ID:amaurihamasu,项目名称:stoq,代码行数:8,代码来源:invoiceitemeditor.py

示例12: __init__

    def __init__(self, store, model):
        # Cache the data. this will save all storables, products and sellables
        # in cache, avoiding future quries when populating the list bellow.
        self._data = list(model.get_inventory_data())

        self._has_adjusted_any = False
        BaseEditor.__init__(self, store, model)
        self._setup_widgets()
开发者ID:hackedbellini,项目名称:stoq,代码行数:8,代码来源:inventoryadjustmenteditor.py

示例13: __init__

    def __init__(self, store, model):
        self.all_items = model.stock_decrease.get_items()
        BaseEditor.__init__(self, store, model)

        for widget in [self.order_lbl, self.sold_lbl, self.cost_lbl,
                       self.expected_lbl, self.returned_lbl, self.total_lbl,
                       self.quantity_sold, self.cost, self.quantity_returned,
                       self.expected_receival_date, self.order]:
            widget.hide()
开发者ID:marianaanselmo,项目名称:stoq,代码行数:9,代码来源:decreaseeditor.py

示例14: __init__

    def __init__(self, store, model):
        """An editor for a loan item.

        :param store: a store.
        :param model: a loan item.
        """
        self.manager = None
        self.proxy = None
        BaseEditor.__init__(self, store, model)
开发者ID:hackedbellini,项目名称:stoq,代码行数:9,代码来源:loanitemeditor.py

示例15: __init__

    def __init__(self, store, model=None, visual_mode=False):
        BaseEditor.__init__(self, store, model, visual_mode)

        # do not let the user change the current station
        if model and get_current_station(store) == model:
            self.name.set_sensitive(False)
            self.is_active.set_sensitive(False)

        self.set_description(self.model.name)
开发者ID:romaia,项目名称:stoq,代码行数:9,代码来源:stationeditor.py


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