Beispiel #1
0
    def put(self):
        """
		PUT verb call
		
		Returns:
			JSON/HTML/PDF view of the dat
		"""
        projectID = int(self.hasMember("project"))
        description = self.hasMember("description")
        author = self.hasMember("author")
        name = self.hasMember("name")
        files = self.hasMember("files").join(",")

        phashID = projectDoc().view("project/admin", key=projectID).first()["_id"]

        projectData = projectDoc().get(phashID)
        projectData.description = description
        projectData.name = name
        projectData.author = author
        projectData.files = files

        projectData.save()

        projectData = projectDoc.view("project/admin", key=projectID).first()

        projectData = dict(projectData)
        projectData["save"] = True

        view = projectView(data=projectData)
        return view.returnData()
Beispiel #2
0
    def post(self):
        """
		POST verb call
		
		Returns:
			JSON/HTML/PDF view of the data.
		"""
        projectID = int(self.hasMember("project"))
        author = self.hasMember("author")
        description = self.hasMember("description")
        name = self.hasMember("name")
        files = self.hasMember("files").join(",")

        projectData = projectDoc(hashID=projectID, author=author, description=description, name=name, files=files)

        projectData.save()

        projectData = projectDoc.view("project/admin", key=projectID).first()

        projectData = dict(projectData)
        projectData["update"] = True

        view = projectView(data=projectData)
        return view.returnData()