Exemplo n.º 1
0
    def post(self, this_id=None):
        self.tv["current_page"] =  "DEVELOPER"
        if this_id:
            developer = Developer.get_by_id(normalize_id(this_id))
        else:
            developer = Developer(id=self.request.get("CODE").strip())

        developer.name = self.request.get("developer_name").strip()
        developer.contacts = self.request.get("developer_contact").strip()

        developer.put()

        self.redirect("/developer?success=successfully added!")
Exemplo n.º 2
0
    def get(self, this_id=None):
        self.tv["current_page"] =  "DEVELOPER"
        if this_id:
            developer = Developer.get_by_id(normalize_id(this_id))
            self.tv["developer"] = developer
        else:
            developers = Developer.query().fetch(100)
            self.tv["developers"] = []

            for developer in developers:
                self.tv["developers"].append(developer.to_object())

            self.render('frontend/developer.html')