@require_GET
def list_documents(request, category=None):
 docs = Document.objects.filter(locale=request.LANGUAGE_CODE).order_by('title')
 if category:
  docs = docs.filter(category=category)
  try:
   category_id = int(category)
  except ValueError:
   raise Http404
  try:
   category = unicode(dict(CATEGORIES)[category_id])
  except KeyError:
   raise Http404
 docs = paginate(request, docs, per_page=DOCUMENTS_PER_PAGE)
 return render(request, 'wiki/list_documents.html', {'documents': docs, 'category': category})

@ require_GET def list_documents ( request , category = None ) : docs = Document . objects . filter ( locale = request . LANGUAGE_CODE ) . order_by ( 'title' ) if category : docs = docs . filter ( category = category ) try : category_id = int ( category ) except ValueError : raise Http404 try : category = unicode ( dict ( CATEGORIES ) [ category_id ] ) except KeyError : raise Http404 docs = paginate ( request , docs , per_page = DOCUMENTS_PER_PAGE ) return render ( request , 'wiki/list_documents.html' , { 'documents' : docs , 'category' : category } )
list wiki documents .