from wiki.models import storage, Document, DocumentNotFound
from wiki.forms import DocumentForm
from wiki.models import storage, Document, DocumentNotFound
from wiki.forms import DocumentForm
document = storage.get(name)
except DocumentNotFound:
document = Document(storage, name=name, text='')
document = storage.get(name)
except DocumentNotFound:
document = Document(storage, name=name, text='')
if request.method == 'POST':
form = DocumentForm(request.POST, instance=document)
if form.is_valid():
if request.method == 'POST':
form = DocumentForm(request.POST, instance=document)
if form.is_valid():