ajax.py 663 Bytes
# -*- coding: utf-8 -*-

from django.template import RequestContext
from django.template.loader import get_template
from common.decorators import ajax
from paginer import types, PaginationList # ech...

# w widokach ajaxowych dobrze jest przechwytywać wyjątki...
@ajax(method='post')
def get_page_content(request, id, type, params, action, page_nr,
                     group_actions=None):
  c = RequestContext(request)
  c['paginer'] = PaginationList()
  c['paginer'].add(id, type, params, action=action, group_actions=group_actions)
  c['id'] = id
  c['page_nr'] = page_nr
  t = get_template('ajax_paginer.html')
  html = t.render(c)
  return {'html': html}