view pylons_app/controllers/tags.py @ 171:52bbeb1e813f

Added universal cache invalidator for two cached functions. added invalidation when repository was added or deleted, and another invalidation when there was a mercurial command involved.
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 21 May 2010 02:44:40 +0200
parents 20dc7a5eb748
children b68b2246e5a6
line wrap: on
line source

import logging

from pylons import tmpl_context as c, app_globals as g, session, request, config, url
from pylons.controllers.util import abort, redirect

from pylons_app.lib.base import BaseController, render
from pylons_app.lib.utils import get_repo_slug
from pylons_app.model.hg_model import HgModel
log = logging.getLogger(__name__)


class TagsController(BaseController):
    def __before__(self):
        c.repos_prefix = config['repos_name']
        c.repo_name = get_repo_slug(request)
        
    def index(self):
        hg_model = HgModel()
        c.repo_info = hg_model.get_repo(c.repo_name)
        c.repo_tags = c.repo_info.tags
        
        return render('tags/tags.html')