(modeladmin, request, selected)
| 453 | location=(ActionLocation.CHANGE_LIST, ActionLocation.CHANGE_FORM), |
| 454 | ) |
| 455 | def 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") |
nothing calls this directly
no test coverage detected
searching dependent graphs…