'Retrieve a list of FileBlobIndex instances for the given file.
If not already present, this will cause it to be stored.
>>> blobs = FileBlob.from_file(fileobj)'

@classmethod
def from_file(cls, fileobj):

    size = 0
    checksum = sha1('')
    for chunk in fileobj:
        size += len(chunk)
        checksum.update(chunk)
    checksum = checksum.hexdigest()
    lock = locks.get('fileblob:upload:{}'.format(checksum), duration=(60 * 10))
    with TimedRetryPolicy(60)(lock.acquire):
        try:
            existing = FileBlob.objects.get(checksum=checksum)
        except FileBlob.DoesNotExist:
            pass
        else:
            return existing
        blob = cls(size=size, checksum=checksum)
        blob.path = cls.generate_unique_path(blob.timestamp)
        storage = get_storage()
        storage.save(blob.path, fileobj)
        blob.save()
    metrics.timing('filestore.blob-size', size)
    return blob
