MCPcopy
hub / github.com/django/django / download

Function download

tests/admin_views/admin.py:455–462  ·  view source on GitHub ↗
(modeladmin, request, selected)

Source from the content-addressed store, hash-verified

453 location=(ActionLocation.CHANGE_LIST, ActionLocation.CHANGE_FORM),
454)
455def download(modeladmin, request, selected):
456 if selected.count() > 1:
457 buf = StringIO("This is the content of the file")
458 else:
459 selected = selected.get()
460 buf = StringIO(f"This is the content of the file written by {selected.name}")
461
462 return StreamingHttpResponse(FileWrapper(buf))
463
464
465@admin.action(description="No permission to run")

Callers

nothing calls this directly

Calls 4

FileWrapperClass · 0.50
countMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…