ajax_history.py 435 Bytes
#-*- coding:utf-8 -*-

from common.decorators import render, ajax, AjaxError
from dictionary.models import History
from dictionary.history import lexeme_tables

@render()
@ajax(method='get', encode_result=False)
def history_table(request, id):
  history_items = History.objects.filter(lexeme__pk=id).order_by('-transaction_began')
  transaction_tables = lexeme_tables(history_items)
  return {'transaction_tables': transaction_tables}