コード例 #1
0
    def post(self):
        user = users.get_current_user()
        if not user or user.email() != '*****@*****.**':
            return

        recordId = self.request.POST["id"]
        project = None
        if recordId is not None and recordId.isdigit():
            #logging.info(recordId)
            #logging.info(long(recordId))
            project = Project.get_by_id(long(recordId))

        if project is None:
            project = Project()

        project.title = self.request.POST["title"]
        project.description = self.request.POST["description"]
        project.link = self.request.POST["link"]
        newKey = project.put()

        self.response.out.write(newKey.id())
コード例 #2
0
ファイル: project.py プロジェクト: matejmusap/Smartninja
 def create(project, project_goal, due_date):
     new_project = Project(project=project,
                           project_goal=project_goal,
                           due_date=due_date)
     project_key = new_project.put()
     return project_key