Пример #1
0
    def processView(self):
        groupID = self.request.matchdict["group"]
        memberID = self.request.matchdict["member"]
        data = getMemberDetails(self.request, groupID, memberID)
        data["member_gender"] = str(data["member_gender"])
        error_summary = {}
        groupName = getGroupName(self.request, groupID)
        if self.request.method == "POST":
            data = self.getPostDict()
            updateMember(
                self.request,
                groupID,
                memberID,
                data["member_name"],
                data["member_tele"],
                data["member_gender"],
                data["member_village"],
            )
            return HTTPFound(
                location=self.request.route_url("members", group=groupID))

        return {
            "error_summary": error_summary,
            "data": data,
            "groupid": groupID,
            "groupname": groupName,
            "memberid": memberID,
        }
Пример #2
0
 def processView(self):
     groupID = self.request.matchdict["group"]
     error_summary = {}
     data = {}
     agents = getAgents(self.request)
     if self.request.method == "POST":
         if "add" in self.request.POST:
             data = self.getPostDict()
             added, message = addAgentToGroup(self.request, groupID,
                                              data["user_id"],
                                              data["access_type"])
             if added:
                 return HTTPFound(location=self.request.route_url(
                     "agents", group=groupID))
             else:
                 error_summary["error"] = message
     groupName = getGroupName(self.request, groupID)
     return {
         "error_summary": error_summary,
         "data": data,
         "agents": agents,
         "groupid": groupID,
         "groupname": groupName,
     }
Пример #3
0
 def processView(self):
     groupID = self.request.matchdict["group"]
     agents = getGroupAgents(self.request, groupID)
     groupName = getGroupName(self.request, groupID)
     return {"agents": agents, "groupid": groupID, "groupname": groupName}
Пример #4
0
 def processView(self):
     groupID = self.request.matchdict["group"]
     members = getGroupMembers(self.request, groupID)
     groupName = getGroupName(self.request, groupID)
     return {"members": members, "groupid": groupID, "groupname": groupName}