Exemple #1
0
 def getAllAdmins(self):
     dao = AdminDAO()
     result = dao.getAllAdmins()
     result_list = []
     for row in result:
         result = self.build_admin_dict(row)
         result_list.append(result)
     return jsonify(Admins=result_list)
Exemple #2
0
    def getAllAdmins(self):
        dao = AdminDAO()
        users = []
        items = dao.getAllAdmins()

        for i in items:
            result = self.build_admin_dict(i)
            users.append(result)

        return jsonify(User=users)
Exemple #3
0
 def getAllAdmins(self):
     dao = AdminDAO()
     admin_list = dao.getAllAdmins()
     if not admin_list:
         return jsonify(Error="Administrator Not Found"), 404
     else:
         result_list = []
         for row in admin_list:
             result = self.build_admin_dict(row)
             result_list.append(result)
         return jsonify(Administrators=result_list)
Exemple #4
0
    def getAllAdmins(self):
        dao = AdminDAO()
        dao1 = UserDAO()
        dao2 = ChatDAO()
        result = dao.getAllAdmins()

        mapped_result = []
        for r in result:
            result2 = dao1.getUserById(r[0])
            result3 = dao2.getChatById(r[1])
            r[0] = result2[1] + " " + result2[2]
            r[1] = result3[1]
            mapped_result.append(self.mapToDict(r))
        return jsonify(Admins=mapped_result)