Beispiel #1
0
    def post(self):
        book = Book()
        
        book.rating = self.request.get('rating')
        book.title = self.request.get('title')

        book.summary = self.request.get('summary') if self.request.get('summary') != book.summary else book.summary
        book.first = self.request.get('first') if self.request.get('first') != book.first else book.first
        book.second = self.request.get('second') if self.request.get('second') != book.second else book.second
        book.third = self.request.get('third') if self.request.get('third') != book.third else book.third

        book.notes = self.request.get('notes') if self.request.get('notes') != book.notes else book.notes

        if book.amazon_link != db.Link(self.request.get('amazon')):
            book.amazon_link = db.Link(self.request.get('amazon'))

        book.url = (self.request.path).lstrip('/edit')

        book.put()

        self.redirect('/%s' % book.url)
Beispiel #2
0
    def post(self):
        book = Book()

        book.rating = self.request.get('rating')
        book.title = self.request.get('title')

        book.summary = self.request.get('summary')
        book.first = self.request.get('first')
        book.second = self.request.get('second')
        book.third = self.request.get('third')

        book.notes = self.request.get('notes')
        
        book.amazon_link = db.Link(self.request.get('amazon'))
        book.url = self.request.get('title').replace(' ', '').lower()
       # book.url = string.translate(url,string.maketrans('',''), string.punctuation)

#        cover = self.request.get('img')
        book.cover = self.request.get('img')

        book.put()

        self.redirect('/')