1 from django.conf import settings
3 from django import http
6 from django.views.generic.simple import direct_to_template
9 from django.contrib.auth.decorators import login_required
10 from django.views.decorators.http import require_POST, require_GET
11 from django.views.decorators.cache import never_cache
14 from django.contrib.contenttypes.models import ContentType
15 from dvcs.models import Document
16 from dcmeta.models import Description
19 def document_list(request):
20 return direct_to_template(request,
21 'wiki/document_list.html', extra_context={
22 'docs': Document.objects.all(),
27 def editor(request, document_id, template_name='wiki/document_details.html'):
30 doc = Document.objects.get(pk=document_id)
31 except Document.DoesNotExist:
34 meta_data = Description.objects.get(object_id=document_id,
35 content_type=ContentType.objects.get_for_model(doc))
37 return direct_to_template(request, template_name, extra_context={
39 'document_name': doc.name,
40 'document_info': meta_data,
41 'document_meta': meta_data,
43 # "text_save": DocumentTextSaveForm(prefix="textsave"),
44 # "add_tag": DocumentTagForm(prefix="addtag"),