- 'document': document,
- 'document_name': document.name,
- 'document_info': dict(document.info(), readonly=True),
- 'document_meta': document.meta,
- })
-
-
-@normalized_name
-def create_missing(request, name):
- storage = getstorage()
-
- if request.method == "POST":
- form = DocumentCreateForm(request.POST, request.FILES)
- if form.is_valid():
- doc = storage.create_document(
- id=form.cleaned_data['id'],
- text=form.cleaned_data['text'],
- )
-
- return http.HttpResponseRedirect(reverse("wiki_details", args=[doc.name]))
- else:
- form = DocumentCreateForm(initial={
- "id": name.replace(" ", "_"),
- "title": name.title(),
- })
-
- return direct_to_template(request, "wiki/document_create_missing.html", extra_context={
- "document_name": name,
- "form": form,