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


Python Channel.get_all_by_target方法代码示例

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


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

示例1: get

# 需要导入模块: from models import Channel [as 别名]
# 或者: from models.Channel import get_all_by_target [as 别名]
 def get(self):
     outlets = Outlet.all().filter('target =', self.account).fetch(100)
     if len(self.request.path.split('/')) > 2:
         source = Account.get_by_hash(self.request.path.split('/')[-1])
         channel = Channel.get_by_source_and_target(source, self.account)
         self.render('templates/source.html', locals())
     else:
         enabled_channels = Channel.get_all_by_target(self.account).order('-count').filter('status =', 'enabled')
         self.render('templates/sources.html', locals())
开发者ID:dcparker,项目名称:notify-io,代码行数:11,代码来源:main.py

示例2: get

# 需要导入模块: from models import Channel [as 别名]
# 或者: from models.Channel import get_all_by_target [as 别名]
 def get(self):
     outlets = Outlet.all().filter("target =", self.account).fetch(100)
     if len(self.request.path.split("/")) > 2:
         source = Account.get_by_hash(self.request.path.split("/")[-1])
         channel = Channel.get_by_source_and_target(source, self.account)
         self.render("templates/source.html", locals())
     else:
         enabled_channels = Channel.get_all_by_target(self.account).order("-count").filter("status =", "enabled")
         # TODO: remove me after a while. this is to fix my poor reference management
         for c in enabled_channels:
             try:
                 c.outlet
             except:
                 c.outlet = None
                 c.put()
         self.render("templates/sources.html", locals())
开发者ID:Mondego,项目名称:pyreco,代码行数:18,代码来源:allPythonContent.py

示例3: initialize

# 需要导入模块: from models import Channel [as 别名]
# 或者: from models.Channel import get_all_by_target [as 别名]
    def initialize(self, request, response):
        super(RequestHandler, self).initialize(request, response)
        self.user = users.get_current_user()
        if self.user:
            self.login_url = None
            self.logout_url = users.create_logout_url("/")
            self.account = Account.all().filter("user =", self.user).get()
            if not self.account:
                # Set up a Notify.io account

                self.account = Account()
                self.account.set_hash_and_key()
                # self.account.source_name = self.user.nick() # More useful default than None
                self.account.put()

                # Create default Desktop Notifier
                o = Outlet(target=self.account, type_name="DesktopNotifier")
                o.set_name("Default Desktop Notifier")
                o.put()

            # This is to update existing accounts before outlets
            if not self.account.get_default_outlet():
                # Create default Desktop Notifier
                o = Outlet(target=self.account, type_name="DesktopNotifier")
                o.set_name("Default Desktop Notifier")
                o.put()
                for channel in Channel.get_all_by_target(self.account):
                    if not channel.outlet:
                        channel.outlet = o
                        channel.put()

        else:
            self.logout_url = None
            self.account = None
            self.login_url = users.create_login_url(request.path)

        # Hide the Get Started tip
        if request.query_string == "hide":
            self.account.started = True
            self.account.put()
开发者ID:Mondego,项目名称:pyreco,代码行数:42,代码来源:allPythonContent.py

示例4: delete

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

示例5: render

# 需要导入模块: from models import Channel [as 别名]
# 或者: from models.Channel import get_all_by_target [as 别名]
 def render(self, template_path, locals):
     locals["pending_channels"] = Channel.get_all_by_target(self.account).filter("status =", "pending").fetch(10)
     locals["recent_notifications"] = Notification.get_history_by_target(self.account).fetch(3)
     super(DashboardHandler, self).render(template_path, locals)
开发者ID:Mondego,项目名称:pyreco,代码行数:6,代码来源:allPythonContent.py


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