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


Python Account.get_by_hash方法代码示例

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


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

示例1: get

# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import get_by_hash [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 Account [as 别名]
# 或者: from models.Account import get_by_hash [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: post

# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import get_by_hash [as 别名]
    def post(self):
        action = self.request.get("action")
        source = Account.get_by_hash(self.request.get("source"))
        channel = Channel.get_by_source_and_target(source, self.account)
        if action == "approve":
            channel.status = "enabled"
            channel.put()
        elif action == "delete":
            channel.delete()
        elif action == "route":
            outlet = Outlet.get_by_hash(self.request.get("outlet"))
            channel.outlet = outlet
            channel.put()

        if "return" in self.request.query_string:
            self.redirect("/sources/%s" % self.request.get("source"))
        else:
            self.redirect("/sources")
开发者ID:Mondego,项目名称:pyreco,代码行数:20,代码来源:allPythonContent.py

示例4: post

# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import get_by_hash [as 别名]
 def post(self):
     action = self.request.get('action')
     source = Account.get_by_hash(self.request.get('source'))
     channel = Channel.get_by_source_and_target(source, self.account)
     if action == 'approve':
         channel.status = 'enabled'
         channel.put()
     elif action == 'delete':
         channel.delete()
     elif action == 'route':
         outlet = Outlet.get_by_hash(self.request.get('outlet'))
         channel.outlet = outlet
         channel.put()
         
     if 'return' in self.request.query_string:
         self.redirect('/sources/%s' % self.request.get('source'))
     else:
         self.redirect('/sources')
开发者ID:Feanorka,项目名称:notify-io,代码行数:20,代码来源:main.py


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