@decorator_from_middleware(GZipMiddleware)
def text(request, slug, chunk=None):
try:
- doc = Chunk.get(slug, chunk).doc
+ doc = Chunk.get(slug, chunk)
except (Chunk.MultipleObjectsReturned, Chunk.DoesNotExist):
raise Http404
form = DocumentTextRevertForm(request.POST, prefix="textrevert")
if form.is_valid():
try:
- doc = Chunk.get(slug, chunk).doc
+ doc = Chunk.get(slug, chunk)
except (Chunk.MultipleObjectsReturned, Chunk.DoesNotExist):
raise Http404
revB = None
try:
- doc = Chunk.get(slug, chunk).doc
+ doc = Chunk.get(slug, chunk)
except (Chunk.MultipleObjectsReturned, Chunk.DoesNotExist):
raise Http404
docA = doc.at_revision(revA).materialize()
@never_cache
def revision(request, slug, chunk=None):
try:
- doc = Chunk.get(slug, chunk).doc
+ doc = Chunk.get(slug, chunk)
except (Chunk.MultipleObjectsReturned, Chunk.DoesNotExist):
raise Http404
return http.HttpResponse(str(doc.revision()))
def history(request, slug, chunk=None):
# TODO: pagination
try:
- doc = Chunk.get(slug, chunk).doc
+ doc = Chunk.get(slug, chunk)
except (Chunk.MultipleObjectsReturned, Chunk.DoesNotExist):
raise Http404