class LeaveEmployeeList(Table): employee_number = Column(field='employee_number', header=u'员工编号') name = Column(field='name', header=u'员工姓名') id_card = Column(field='identification_card', header=u'身份证号码') age = Column(field='age', header=u'年龄') work_age = Column(field='work_age_display', header=u'工龄') local_age = Column(field='local_age', header=u'行龄') employee_type = Column(field='employee_type', header=u'员工性质') titles = Column(field='titles', header=u'职称') department = Column(field='department.name', header=u'机构名称') department_type = Column(field='department.type', header=u'机构类型') job = Column(field='job', header=u'岗位') leaveDaysTotal = Column(field='leaveDaysTotal', header=u'年总休假') leaveDaysLeft = Column(field='leaveDaysLeft', header=u'年余休假') link = LinkColumn( header=u'', links=[ ImageLink(viewname='LEAVE:LEAVE_ADD', args=(A('employee_number'), ), image='/media/base_site/icons/add.png', image_title=u'休假登记') ], sortable=False, ) class Meta: id = u'休假员工表' model = Employee table_title = u'休假员工表' attrs = {'class': 'table-bordered table-hover table-striped'} thead_attrs = {'class': 'bg-navy disabled color-palette'}
class TransferOrderList(Table): transfer_number = Column(field='transfer_number', header=u'调令编号') employee_number = Column(field='employee.employee_number', header=u'员工编号') name = Column(field='employee.name', header=u'员工姓名') old_department = Column(field='old_department.name', header=u'原部门') old_job = Column(field='old_job', header=u'原岗位') new_department = Column(field='new_department.name', header=u'现部门') new_job = Column(field='new_job', header=u'现岗位') transfer_date = Column(field='transfer_date', header=u'调用日期') new_department_salary_calculate_start_date = Column( field='new_department_salary_calculate_start_date', header=u'新单位起薪日期') transfer_reason = Column(field='transfer_reason', header=u'调动原因') confirm = Column(field='confirm', header=u'同步到员工信息') link = LinkColumn( header=u'', links=[ ImageLink(viewname='EMPLOYEE:TRANSFER_DETAIL', args=(A('transfer_number'), ), image='/media/base_site/icons/edit.png', image_title=u'查看详细') ], sortable=False, ) class Meta: id = u'员工调令表' model = TransferOrder table_title = u'员工调令表' attrs = {'class': 'table-bordered table-hover table-striped'} thead_attrs = {'class': 'bg-navy disabled color-palette'}
class GenotypeTable(Table): strain = Column(field='strain', header=u'STRAIN') line = Column(field='line', header=u'LINE') locus = Column(field='locus', header=u'LOCUS') sex = Column(field='sex', header=u'SEX') avatar = LinkColumn(header=u'AVATAR', links=[ ImageLink(viewname='mouse_profile', args=(A('id'),), image=image_url, image_title='avatar')]) class Meta: model = Genotype
class MateTable(Table): id = Column(field='mate_id', header=u'ID') paid = Column(field='paternal_id', header=u'PA_ID') maid = Column(field='maternal_id', header=u'MA_ID') avatar = LinkColumn(header=u'AVATAR', links=[ ImageLink(viewname='mouse_profile', args=(A('id'),), image=image_url, image_title='avatar')]) # logo = ImageColumn(field='logo.url', header=u'Logo Image', # image_title='logo') class Meta: model = Breed
def test_imagelink(self): image_link = ImageLink(image="test.jpg", image_title="foo") self.assertEqual(image_link.render({}), '<a ><img src="/static/test.jpg" title="foo"></a>') image_link = ImageLink(image="test.jpg", image_title=A("foo")) self.assertEqual(image_link.render({"foo": "bar"}), '<a ><img src="/static/test.jpg" title="bar"></a>')
class MouseTable(Table): id = Column(field='mouse_id', header=u'ID') name = Column(field='name', header=u'NAME') status = Column(field='status', header=u'STATUS') notes = Column(field='notes', header=u'NOTE') dob = Column(field='dob', header=u'BIRTH') dod = Column(field='dod', header=u'DEAD') avatar = LinkColumn(header=u'AVATAR', links=[ ImageLink(viewname='mouse_profile', args=(A('id'),), image=image_url, image_title='avatar')]) class Meta: model = Mouse
class LeaveList(Table): id = Column(field='id', header=u'休假登记编号') employee = Column(field='employee.employee_number', header=u'员工编号') name = Column(field='employee.name', header=u'员工姓名') leave_type = Column(field='leave_type', header=u'休假类型') start_date = Column(field='start_date', header=u'开始日期') end_date = Column(field='end_date', header=u'结束日期') duration = Column(field='duration', header=u'休假天数') reason = Column(field='reason', header=u'休假原因') link = LinkColumn( header=u'', links=[ ImageLink(viewname='LEAVE:LEAVE_CHANGE', args=(A('id'), ), image='/media/base_site/icons/edit.png', image_title=u'修改休假记录') ], sortable=False, ) link2 = LinkColumn( header=u'', links=[ ImageLink(viewname='LEAVE:LEAVE_DELETE', args=(A('id'), ), image='/media/base_site/icons/delete.png', image_title=u'删除休假记录') ], sortable=False, ) class Meta: id = u'员工休假表' model = Leave table_title = u'员工休假表' attrs = {'class': 'table-bordered table-hover table-striped'} thead_attrs = {'class': 'bg-navy disabled color-palette'}
class LinkColumnTable(Table): id = Column(field='id', header=u'#') name = LinkColumn(header=u'NAME', links=[ Link(viewname='user_profile', args=(A('id'), ), text=A('name')) ]) avatar = LinkColumn(header=u'AVATAR', links=[ ImageLink(viewname='user_profile', args=(A('id'), ), image=image_url, image_title='avatar') ]) class Meta: model = Person
class DepartmentList(Table): department_number = Column(field='department_number', header=u'机构编号') name = Column(field='name', header=u'机构名称') type = Column(field='type', header=u'机构类型') address = Column(field='address', header=u'机构地址') phone = Column(field='phone', header=u'机构电话') parent_structure = Column(field='parent_structure', header=u'上级机构') link = LinkColumn(header=u'', links=[ ImageLink(viewname='DEPARTMENT:DEPARTMENT_DETAIL', args=(A('department_number'),), image='/media/base_site/icons/edit.png', image_title=u'查看详细')], sortable=False, ) class Meta: id = u'机构信息表' model = Department table_title = u'机构信息表' attrs = {'class': 'table-bordered table-hover table-striped'} thead_attrs ={'class': 'bg-navy disabled color-palette'}
class LinkColumnTable(Table): id = Column(field='id', header='#') name = LinkColumn(header='NAME', links=[ Link(viewname='user_profile', args=(A('id'), ), text=A('name')) ]) avatar = LinkColumn(header='AVATAR', links=[ ImageLink(viewname='user_profile', args=(A('id'), ), image=image_path, image_title='avatar') ]) # logo = ImageColumn(field='logo.url', header='Logo Image', image_title='logo') class Meta: model = Person
class EmployeeList(Table): employee_number = Column(field='employee_number', header=u'员工编号') name = Column(field='name', header=u'员工姓名') id_card = Column(field='identification_card', header=u'身份证号码') gender = Column(field='gender', header=u'性别') nationality = Column(field='nationality', header=u'民族') age = Column(field='age', header=u'年龄') work_age = Column(field='work_age_display', header=u'工龄') local_age = Column(field='local_age', header=u'行龄') employee_type = Column(field='employee_type', header=u'员工性质') titles = Column(field='titles', header=u'职称') department = Column(field='department.name', header=u'机构名称') department_type = Column(field='department.type', header=u'机构类型') job = Column(field='job', header=u'岗位') political_status = Column(field='political_status', header=u'政治面貌') contract_start_date = Column(field='contracts.start_date', header=u'合同开始') contract_end_date = Column(field='contracts.end_date', header=u'合同结束') contract_duration = Column(field='contracts.duration', header=u'合同期限(年)') first_eduction_graduate_from = Column(field='first_eduction.graduate_from', header=u'毕业院校') first_eduction_qualification = Column(field='first_eduction.qualification', header=u'学历') first_eduction_major = Column(field='first_eduction.major', header=u'专业') link = LinkColumn( header=u'', links=[ ImageLink(viewname='EMPLOYEE:EMPLOYEE_DETAIL', args=(A('employee_number'), 'workexperience'), image='/media/base_site/icons/edit.png', image_title=u'查看详细') ], sortable=False, ) class Meta: id = u'员工花名册' model = Employee table_title = u'员工花名册' attrs = {'class': 'table-bordered table-hover table-striped'} thead_attrs = {'class': 'bg-navy disabled color-palette'}
class DimissionList(Table): id = Column(field='id', header=u'离职编号') employee = Column(field='employee', header=u'员工编号') name = Column(field='employee.name', header=u'员工姓名') dimission_date = Column(field='dimission_date', header=u'离职日期') record_date = Column(field='record_date', header=u'登记日期') reason = Column(field='reason', header=u'离职原因') link = LinkColumn( header=u'', links=[ ImageLink(viewname='EMPLOYEE:DIMISSION_DELETE', args=(A('id'), ), image='/media/base_site/icons/delete.png', image_title=u'删除离职登记') ], sortable=False, ) class Meta: id = u'离职登记表' model = Dimission table_title = u'离职登记表' attrs = {'class': 'table-bordered table-hover table-striped'} thead_attrs = {'class': 'bg-navy disabled color-palette'}