示例#1
0
    def _get_data(self):
        from dal.dao import Dao
        from models.project import Project
        from models.employee import Employee
        from models.assignment import Assignment

        dao = Dao(db_path=self.db_path, stateful=True)
        self._prj_rex = Project.get_all(dao)
        self._emp_rex = Employee.get_all(dao)
        self._asn_rex = Assignment.get_all(dao)
        dao.close()
示例#2
0
def prj_list():
    # app.logger.info('User has opened Projects.')
    rex = Project.get_all()
    prjs = [rec.serialize() for rec in rex] if rex else []

    rex = Employee.get_all()
    emps = [{'id': rec.id, 'name': rec.name} for rec in rex]

    rex = Assignment.get_all()
    asns = [rec.serialize() for rec in rex] if rex else []

    return render_template('projects/project_panel.html',
                           title='allocat projects',
                           projects=prjs,
                           employees=emps,
                           assignments=asns)