本文整理汇总了Python中stoqlib.gui.templates.persontemplate.BasePersonRoleEditor类的典型用法代码示例。如果您正苦于以下问题:Python BasePersonRoleEditor类的具体用法?Python BasePersonRoleEditor怎么用?Python BasePersonRoleEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BasePersonRoleEditor类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setup_slaves
def setup_slaves(self):
BasePersonRoleEditor.setup_slaves(self)
if not self.individual_slave:
raise ValueError('This editor must have an individual slave')
self.details_slave = EmployeeDetailsSlave(self.store, self.model,
visual_mode=self.visual_mode)
custom_tab_label = _('Employee Data')
slave = self.individual_slave
slave._person_slave.add_extra_tab(custom_tab_label, self.details_slave)
self.status_slave = EmployeeStatusSlave(self.store, self.model,
visual_mode=self.visual_mode)
slave.attach_person_slave(self.status_slave)
self.role_slave = EmployeeRoleSlave(self.store, self.model,
edit_mode=self.edit_mode,
visual_mode=self.visual_mode)
db_form = self._person_slave.db_form
slave._person_slave.attach_role_slave(self.role_slave)
if db_form:
db_form.update_widget(self.role_slave.role,
other=self.role_slave.role_lbl)
db_form.update_widget(self.role_slave.salary,
other=self.role_slave.salary_lbl)
history_tab_label = _("Role History")
history_slave = EmployeeRoleHistorySlave(self.model)
slave._person_slave.add_extra_tab(history_tab_label, history_slave)
开发者ID:Joaldino,项目名称:stoq,代码行数:27,代码来源:personeditor.py
示例2: setup_slaves
def setup_slaves(self):
BasePersonRoleEditor.setup_slaves(self)
user_status = UserStatusSlave(self.store, self.model,
visual_mode=self.visual_mode)
self.main_slave.attach_person_slave(user_status)
passwd_fields = not self.edit_mode
self.user_details = UserDetailsSlave(self.store, self.model,
show_password_fields=passwd_fields,
visual_mode=self.visual_mode)
tab_text = _('User Details')
self.main_slave._person_slave.attach_custom_slave(self.user_details,
tab_text)
tab_child = self.main_slave._person_slave.custom_tab
notebook = self.main_slave._person_slave.person_notebook
notebook.reorder_child(tab_child, position=self.USER_TAB_POSITION)
notebook.set_current_page(self.USER_TAB_POSITION)
tab_text = _('Branch Access')
self.user_branches = UserBranchAccessSlave(self.store, self.model)
# XXX: workaround border being to large
self.user_branches.vbox1.set_border_width(0)
self.main_slave._person_slave.attach_extra_slave(self.user_branches,
tab_text)
开发者ID:romaia,项目名称:stoq,代码行数:26,代码来源:personeditor.py
示例3: setup_slaves
def setup_slaves(self):
from .opticalslave import MedicDetailsSlave
BasePersonRoleEditor.setup_slaves(self)
tab_text = _('Medic Details')
self.medic_details_slave = MedicDetailsSlave(self.store, self.model,
visual_mode=self.visual_mode)
self.main_slave._person_slave.add_extra_tab(tab_text,
self.medic_details_slave)
开发者ID:hackedbellini,项目名称:stoq,代码行数:9,代码来源:opticaleditor.py
示例4: setup_slaves
def setup_slaves(self):
BasePersonRoleEditor.setup_slaves(self)
self.status_slave = ClientStatusSlave(self.store, self.model,
visual_mode=self.visual_mode)
self.main_slave.attach_person_slave(self.status_slave)
credit_slave = ClientCreditSlave(self.store, self.model,
visual_mode=self.visual_mode)
self.main_slave._person_slave.add_extra_tab('Credit Details',
credit_slave)
开发者ID:leandrorchaves,项目名称:stoq,代码行数:10,代码来源:personeditor.py
示例5: __init__
def __init__(self, store, model=None, person=None, role_type=None,
visual_mode=False, parent=None, document=None):
self.visual_mode = visual_mode
# Do not allow users of one branch edit employee from a different
# branch
if (model and model.branch and
not model.branch == api.get_current_branch(store)):
self.visual_mode = True
BasePersonRoleEditor.__init__(self, store, model, role_type=role_type,
person=person, visual_mode=self.visual_mode,
parent=parent, document=document)
开发者ID:Joaldino,项目名称:stoq,代码行数:13,代码来源:personeditor.py
示例6: create_model
def create_model(self, store):
person = BasePersonRoleEditor.create_model(self, store)
transporter = person.transporter
if transporter is None:
transporter = Transporter(person=person,
store=store)
return transporter
开发者ID:Joaldino,项目名称:stoq,代码行数:7,代码来源:personeditor.py
示例7: create_model
def create_model(self, store):
person = BasePersonRoleEditor.create_model(self, store)
publisher = store.find(BookPublisher, person=person).one()
if publisher is None:
publisher = BookPublisher(person=person,
store=store)
return publisher
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:publishersearch.py
示例8: create_model
def create_model(self, store):
# Document used in MedicEditor is the CRM number
crm = self.document
self.document = None
person = BasePersonRoleEditor.create_model(self, store)
medic = store.find(OpticalMedic, person=person).one()
if medic is None:
medic = OpticalMedic(person=person, store=store, crm_number=crm)
return medic
开发者ID:hackedbellini,项目名称:stoq,代码行数:10,代码来源:opticaleditor.py
示例9: create_model
def create_model(self, store):
person = BasePersonRoleEditor.create_model(self, store)
medic = store.find(OpticalMedic, person=person).one()
if medic is None:
medic = OpticalMedic(person=person, store=store)
return medic
开发者ID:LeonamSilva,项目名称:stoq,代码行数:6,代码来源:opticaleditor.py
注:本文中的stoqlib.gui.templates.persontemplate.BasePersonRoleEditor类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论