本文整理汇总了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))
示例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)
示例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)
示例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()
示例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)
示例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()
示例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)
示例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)
示例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)
示例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))
示例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)
示例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()
示例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()
示例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)
示例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)