wdmmg / wdmmg / controllers /

import logging

from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect

from wdmmg.lib.base import BaseController, render
from wdmmg.lib.helpers import Page
from wdmmg.lib.helpers import dept_name_to_wdtk_identifier
from wdmmg import model

log = logging.getLogger(__name__)

class EntryController(BaseController):
    def index(self):
        query = model.Entry.find() = Page(
            page=int(request.params.get('page', 1)),
        return render('entry/index.html')

    def view(self, id=None):
        c.row = model.Entry.by_id(id)
        if not c.row:
            abort(404, 'Sorry, there is no entry with code %r'% id)
        c.desc = c.row.explain() = c.row.get('_id')
        del c.row['_id']
        c.from_ = c.row.get('from')
        del c.row['from'] = c.row.get('to')
        del c.row['to']
        c.dataset = c.row.get('dataset')
        del c.row['dataset']
        c.currency = c.row.get('currency', c.dataset.get('currency')).upper()
        if c.row.get('currency'):
            del c.row['currency']
        c.amount = c.row.get('amount')
        del c.row['amount']
        c.time = c.row.get('time')
        del c.row['time']
        if 'departments' in c.dataset.get('name'):
            c.show_foi = True
            c.show_foi = False
        return render('entry/view.html')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.