当前位置: 首页>>代码示例>>Python>>正文


Python Book.second方法代码示例

本文整理汇总了Python中models.Book.second方法的典型用法代码示例。如果您正苦于以下问题:Python Book.second方法的具体用法?Python Book.second怎么用?Python Book.second使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Book的用法示例。


在下文中一共展示了Book.second方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: post

# 需要导入模块: from models import Book [as 别名]
# 或者: from models.Book import second [as 别名]
    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)
开发者ID:leogau,项目名称:booksapp,代码行数:23,代码来源:book.py

示例2: post

# 需要导入模块: from models import Book [as 别名]
# 或者: from models.Book import second [as 别名]
    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('/')
开发者ID:leogau,项目名称:booksapp,代码行数:25,代码来源:admin.py


注:本文中的models.Book.second方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。