Ejemplo n.º 1
0
    def manage(self, app, action, **kwargs):
        ''' return the headlines management template'''
 
        user = cherrypy.session['user']['name'] 
        host_app = cherrypy.request.path_info.split('/')[3]

        headlines = Headlines.all()
        headlines = headlines.filter_by_app(app)
   
        return self.render_template('/%s:/templates/unixHeadlines/headlines_manage.html' % host_app,
                                    dict(host_app=host_app, headlines=headlines, app=app))
Ejemplo n.º 2
0
    def manage(self, app, action, **kwargs):
        ''' return the headlines management template'''

        user = cherrypy.session['user']['name']
        host_app = cherrypy.request.path_info.split('/')[3]

        headlines = Headlines.all()
        headlines = headlines.filter_by_app(app)

        return self.render_template(
            '/%s:/templates/unixHeadlines/headlines_manage.html' % host_app,
            dict(host_app=host_app, headlines=headlines, app=app))
Ejemplo n.º 3
0
    def list(self, app, action, **kwargs):
        ''' return headlines'''

        output = {'headlines': []} 
        user = cherrypy.session['user']['name'] 
        host_app = cherrypy.request.path_info.split('/')[3]

        count = int(kwargs.get('count', '10'))
        earliest = kwargs.get('earliest', None)
        severity = kwargs.get('severity', ['1','2','3','4','5'])

        headlines = Headlines.all()
        headlines = headlines.filter_by_app(app)
        headlines = headlines.filter_by_user(user)
      
        output['headlines'] = self.get_headlines_detail(headlines, app, user, 
                                                        count, earliest, severity=severity, srtd=True)

        return self.render_json(output)
Ejemplo n.º 4
0
    def list(self, app, action, **kwargs):
        ''' return headlines'''

        output = {'headlines': []}
        user = cherrypy.session['user']['name']
        host_app = cherrypy.request.path_info.split('/')[3]

        count = int(kwargs.get('count', '10'))
        earliest = kwargs.get('earliest', None)
        severity = kwargs.get('severity', ['1', '2', '3', '4', '5'])

        headlines = Headlines.all()
        headlines = headlines.filter_by_app(app)
        headlines = headlines.filter_by_user(user)

        output['headlines'] = self.get_headlines_detail(headlines,
                                                        app,
                                                        user,
                                                        count,
                                                        earliest,
                                                        severity=severity,
                                                        srtd=True)

        return self.render_json(output)