oioioi.filetracker.utils¶
Module Contents¶
Classes¶
A stub |
Functions¶
|
Returns the filetracker path of a |
|
Returns a |
|
Returns a Content-Disposition header field per RFC 6266 |
|
Returns a |
- class oioioi.filetracker.utils.FileInFiletracker(storage, name)[source]¶
Bases:
django.core.files.FileA stub
django.core.files.Filesubclass for assigning existing Filetracker files to :class:`django.db.models.FileField`s.Usage:
some_model_instance.file_field = filetracker_to_django_file('some/path')
- oioioi.filetracker.utils.django_to_filetracker_path(django_file)[source]¶
Returns the filetracker path of a
django.core.files.File.
- oioioi.filetracker.utils.filetracker_to_django_file(filetracker_path, storage=None)[source]¶
Returns a
Filerepresenting an existing Filetracker file (usable only for assigning to aFileField)
- oioioi.filetracker.utils.make_content_disposition_header(disposition, filename)[source]¶
Returns a Content-Disposition header field per RFC 6266 as a bytestring.
The
dispositionargument should be eitherinlineorattachmentand the filename should be a unicode object, which need not be sanitized.
- oioioi.filetracker.utils.stream_file(django_file, name=None, showable=None)[source]¶
Returns a
HttpResponserepresenting a file download.Optional argument
namesets default filename under which user is prompted to save thatdjango_file.Some types of files, as listed below in
showable_extsvariable, may by default be displayed in browser. Other are forced to be downloaded. Usingshowableflag, default behaviour may be overriden in both directions.