Exemplo n.º 1
0
 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())
Exemplo n.º 2
0
 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())
Exemplo n.º 3
0
 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())
Exemplo n.º 4
0
    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")
Exemplo n.º 5
0
 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')
Exemplo n.º 6
0
    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')