Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / controllers / feeds.py @ adb0e63f

History | View | Annotate | Download (1.03 KB)

1
# -*- coding: utf-8 -*-
2
"""Sample controller module"""
3

    
4
import logging
5
from tg import expose, redirect, config, request, response
6
from pylons.i18n import ugettext as _
7
from datetime import datetime
8
from repoze.what.predicates import Any, has_permission, in_group
9
from tg.controllers import CUSTOM_CONTENT_TYPE
10

    
11
from vigilo.turbogears.controllers import BaseController
12

    
13
LOGGER = logging.getLogger(__name__)
14

    
15
__all__ = ['FeedsController']
16

    
17
class FeedsController(BaseController):
18
    # pylint: disable-msg=R0201,W0613
19

    
20
    @expose('atom.xml', content_type=CUSTOM_CONTENT_TYPE)
21
    def atom(self, token, username):
22
        """
23
        """
24
        response.headers['Content-Type'] = 'application/atom+xml'
25
        return {
26
            'feed': {
27
                'title': 'VigiBoard',
28
                'mtime': datetime.now(),
29
            },
30
            'entries': [
31
                {
32
                    'title': 'Test',
33
                    'mtime': datetime.now(),
34
                    'summary': 'Foo bar on baz',
35
                }
36
            ],
37
        }