# Path: bundestagger/helper/utils.py
# def invalidate_cache(path, *args):
#     page = None
#     if len(args)==2:
#         index, max_per_page = args
#         page = get_page(index, max_per_page)
#     if page is not None and page != 1:
#         request = FakeRequest(path, {"page": page})
#     else:
#         request = FakeRequest(path)
#     cache.delete(get_cache_key(request))
# 
# def is_get(func):
#     return is_method("GET", func)


from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, Http404, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed
from django.template import RequestContext, loader, Context
from django.utils.itercompat import groupby
from django.core.paginator import Paginator
from django.views.decorators.cache import cache_page
from django.conf import settings
from bundestagger.bundesstats.models import *
from bundestagger.helper.utils import invalidate_cache, is_get


@is_get
def show(request):
    feature_ranks = FeatureRank.objects.all()
    features = groupby(feature_ranks, lambda fr: fr.feature)

# Path: bundestagger/helper/utils.py
# def invalidate_cache(path, *args):
#     page = None
#     if len(args)==2:
#         index, max_per_page = args
#         page = get_page(index, max_per_page)
#     if page is not None and page != 1:
#         request = FakeRequest(path, {"page": page})
#     else:
#         request = FakeRequest(path)
#     cache.delete(get_cache_key(request))
# 
# def is_get(func):
#     return is_method("GET", func)


# Path: bundestagger/bundesstats/views.py
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, Http404, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed
from django.template import RequestContext, loader, Context
from django.utils.itercompat import groupby
from django.core.paginator import Paginator
from django.views.decorators.cache import cache_page
from django.conf import settings
from bundestagger.bundesstats.models import *
from bundestagger.helper.utils import invalidate_cache, is_get



@is_get
def show(request):
    feature_ranks = FeatureRank.objects.all()
    features = groupby(feature_ranks, lambda fr: fr.feature)

    new_features = []