예제 #1
0
 def post(self):
     self.response.headers['Content-Type'] = 'application/json'
     
     newAttachment = MilestoneAttachment(milestone_id = self.request.get('milestone_id'))
     newAttachment.description = self.request.get('description')
     newAttachment.image = PostImage(self.request.POST.multi['image'])
     newAttachment.time = getTimeEpoch()
     
     newAttachment.put()
     
     self.response.write(json.dumps({'attachment_id' : str(newAttachment.key())}))
예제 #2
0
    def post(self):
        self.response.headers['Content-Type'] = 'application/json'

        newAttachment = MilestoneAttachment(
            milestone_id=self.request.get('milestone_id'))
        newAttachment.description = self.request.get('description')
        newAttachment.image = PostImage(self.request.POST.multi['image'])
        newAttachment.time = getTimeEpoch()

        newAttachment.put()

        self.response.write(
            json.dumps({'attachment_id': str(newAttachment.key())}))