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


Python Notification.all方法代码示例

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


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

示例1: post

# 需要导入模块: from models import Notification [as 别名]
# 或者: from models.Notification import all [as 别名]
 def post(self): 
     notice_hash = self.request.path.split('/')[-1]
     notice = Notification.all().filter('hash =', notice_hash).get()
     target = Account.all().filter('api_key =', self.request.get('api_key')).get()
     channel = notice.channel
     if notice and channel.status == 'enabled' and channel.target.key() == target.key():
         self.response.out.write(notice.dispatch())
     else:
         self.error(404)
开发者ID:DFectuoso,项目名称:notify-io,代码行数:11,代码来源:api.py

示例2: get

# 需要导入模块: from models import Notification [as 别名]
# 或者: from models.Notification import all [as 别名]
  def get(self):
    session = get_current_session()
    if session.has_key('user'):
      user = session['user']
      page = helper.sanitizeHtml(self.request.get('pagina'))
      perPage = 10
      page = int(page) if page else 1
      realPage = page - 1
      inboxAll = True
      if realPage > 0:
        prevPage = realPage
      if (page * perPage) < Notification.all().filter("target_user =",user).count():
        nextPage = page + 1
 
      notifications = Notification.all().filter("target_user =",user).order("-created").fetch(perPage,perPage * realPage)
      prefetch.prefetch_refprops(notifications,Notification.post,Notification.comment,Notification.sender_user)
      self.response.out.write(template.render('templates/notifications.html', locals()))
    else:
      self.redirect('/login')
开发者ID:mantus,项目名称:Noticias-HAcker,代码行数:21,代码来源:main.py

示例3: post

# 需要导入模块: from models import Notification [as 别名]
# 或者: from models.Notification import all [as 别名]
 def post(self, hash):
     hash = hash.lower()
     notice = Notification.all().filter("hash =", hash).get()
     target = Account.all().filter("api_key =", self.request.get("api_key")).get()
     channel = notice.channel
     if notice and channel.status == "enabled" and channel.target.key() == target.key():
         notice.dispatch()
         self.response.out.write("OK\n")
     else:
         self.error(404)
开发者ID:Mondego,项目名称:pyreco,代码行数:12,代码来源:allPythonContent.py

示例4: get

# 需要导入模块: from models import Notification [as 别名]
# 或者: from models.Notification import all [as 别名]
 def get(self):
   user = users.get_current_user()
   notifications_q = Notification.all().filter("user == ", user)\
       .filter("read ==", False).order("-time")
   notifications = []
   for n in notifications_q:
     try:
       n.item_cl.title
     except ReferencePropertyResolveError:
       n.delete()
     else:
       notifications.append(n)
     
   helpers.createResponse(self, 'notifications.html', {'notifications': notifications})
开发者ID:yoooyle,项目名称:checklist,代码行数:16,代码来源:notify.py

示例5: get

# 需要导入模块: from models import Notification [as 别名]
# 或者: from models.Notification import all [as 别名]
    def get(self):
        user = users.get_current_user()
        if not user:
            uri = users.create_login_url('/')
            self.redirect(uri)
            return

        template_values = {
            'notifications': Notification.all().filter('owner = ', user),
            'user': user
        }

        path = os.path.join(os.path.dirname(__file__), 'templates', 'index.html')
        self.response.out.write(template.render(path, template_values))
开发者ID:notnoop,项目名称:delayedme,代码行数:16,代码来源:main.py

示例6: get

# 需要导入模块: from models import Notification [as 别名]
# 或者: from models.Notification import all [as 别名]
 def get(self):
   notifications = Notification.all().fetch(2000)
   for notification in notifications:
     taskqueue.add(url='/admin/delete-notification-of-deleted-comments', params={'notification_key': str(notification.key())})
开发者ID:DFectuoso,项目名称:Noticias-HAcker,代码行数:6,代码来源:admin.py

示例7: delete

# 需要导入模块: from models import Notification [as 别名]
# 或者: from models.Notification import all [as 别名]
 def delete(self):
     notices = Notification.all().filter("channel =", self)
     for n in notices:
         n.channel = None
         n.put()
     super(Channel, self).delete()
开发者ID:Mondego,项目名称:pyreco,代码行数:8,代码来源:allPythonContent.py


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