Пример #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'
     
     newJourney = Journey(user_id = str(self.current_user.key.id()))
     
     newJourney.name = self.request.get('name')
     newJourney.description = self.request.get('description')
     newJourney.image = PostImage(self.request.POST.multi['image'])
     newJourney.time = getTimeEpoch()
     
     newJourney.put()
     
     self.response.write(json.dumps({'journey_id' : str(newJourney.key())}))
Пример #3
0
 def post(self):
     self.response.headers['Content-Type'] = 'application/json'
     
     newMilestone = Milestone(journey_id = self.request.get('journey_id'))
     
     newMilestone.latitude = float(self.request.get('latitude'))
     newMilestone.longitude = float(self.request.get('longitude'))
     newMilestone.location = self.request.get('location')
     newMilestone.time = getTimeEpoch()
     
     newMilestone.put()
     
     self.response.write(json.dumps({'milestone_id' : str(newMilestone.key())}))
Пример #4
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())}))
Пример #5
0
    def post(self):
        self.response.headers['Content-Type'] = 'application/json'

        newMilestone = Milestone(journey_id=self.request.get('journey_id'))

        newMilestone.latitude = float(self.request.get('latitude'))
        newMilestone.longitude = float(self.request.get('longitude'))
        newMilestone.location = self.request.get('location')
        newMilestone.time = getTimeEpoch()

        newMilestone.put()

        self.response.write(
            json.dumps({'milestone_id': str(newMilestone.key())}))
Пример #6
0
 def post(self):
     self.response.headers['Content-Type'] = 'application/json'
     
     userId = str(self.current_user.key.id())
     
     newBlog = Blog(user_id = userId,journey_id = self.request.get('journey_id'))
     newBlog.blog_id = self.request.get('blog_id')
     newBlog.blog_link = self.request.get('blog_link')
     newBlog.blog_url = self.request.get('blog_url')
     newBlog.blog_content = self.request.get('blog_content')
     newBlog.post_time = getTimeEpoch()
     
     newBlog.put()
     
     self.response.write(json.dumps({'blog_id' : str(newBlog.key())}))
Пример #7
0
    def post(self):
        self.response.headers['Content-Type'] = 'application/json'

        userId = str(self.current_user.key.id())

        newBlog = Blog(user_id=userId,
                       journey_id=self.request.get('journey_id'))
        newBlog.blog_id = self.request.get('blog_id')
        newBlog.blog_link = self.request.get('blog_link')
        newBlog.blog_url = self.request.get('blog_url')
        newBlog.blog_content = self.request.get('blog_content')
        newBlog.post_time = getTimeEpoch()

        newBlog.put()

        self.response.write(json.dumps({'blog_id': str(newBlog.key())}))