web/views/idownloadable.py
changeset 237 3df2e0ae2eba
parent 0 b97547f5f1fa
child 249 5ab64969df20
equal deleted inserted replaced
236:8ab9e72dd8f1 237:3df2e0ae2eba
     8 
     8 
     9 from logilab.mtconverter import BINARY_ENCODINGS, TransformError, html_escape
     9 from logilab.mtconverter import BINARY_ENCODINGS, TransformError, html_escape
    10 
    10 
    11 from cubicweb.interfaces import IDownloadable
    11 from cubicweb.interfaces import IDownloadable
    12 from cubicweb.common.mttransforms import ENGINE
    12 from cubicweb.common.mttransforms import ENGINE
    13 from cubicweb.common.selectors import (onelinerset_selector, score_entity_selector,
    13 from cubicweb.common.selectors import (one_line_rset, score_entity_selector,
    14                                     interface_selector)
    14                                     interface_selector)
    15 from cubicweb.web.views import baseviews
    15 from cubicweb.web.views import baseviews
    16 
    16 
    17 _ = unicode
    17 _ = unicode
    18 
    18 
    31 class DownloadView(baseviews.EntityView):
    31 class DownloadView(baseviews.EntityView):
    32     """this view is replacing the deprecated 'download' controller and allow downloading
    32     """this view is replacing the deprecated 'download' controller and allow downloading
    33     of entities providing the necessary interface
    33     of entities providing the necessary interface
    34     """
    34     """
    35     id = 'download'
    35     id = 'download'
    36     __selectors__ = (onelinerset_selector, interface_selector)
    36     __selectors__ = (one_line_rset, interface_selector)
    37     accepts_interfaces = (IDownloadable,)
    37     accepts_interfaces = (IDownloadable,)
    38 
    38 
    39     templatable = False
    39     templatable = False
    40     content_type = 'application/octet-stream'
    40     content_type = 'application/octet-stream'
    41     binary = True
    41     binary = True