File: utils.py

package info (click to toggle)
python-django-storages 1.14.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 896 kB
  • sloc: python: 4,548; makefile: 119; sh: 6
file content (12 lines) | stat: -rw-r--r-- 256 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
from django.core.files.base import ContentFile


class NonSeekableContentFile(ContentFile):
    def open(self, mode=None):
        return self

    def seekable(self):
        return False

    def seek(self, pos, whence=0):
        raise AttributeError()