web/views/vcard.py
changeset 5877 0c7b7b76a84f
parent 5424 8ecbcbff9777
child 8190 2a3c1b787688
equal deleted inserted replaced
5876:e77aa963fb19 5877:0c7b7b76a84f
    18 """vcard import / export
    18 """vcard import / export
    19 
    19 
    20 """
    20 """
    21 __docformat__ = "restructuredtext en"
    21 __docformat__ = "restructuredtext en"
    22 
    22 
    23 from cubicweb.selectors import implements
    23 from cubicweb.selectors import is_instance
    24 from cubicweb.view import EntityView
    24 from cubicweb.view import EntityView
    25 
    25 
    26 _ = unicode
    26 _ = unicode
    27 
    27 
    28 VCARD_PHONE_TYPES = {'home': 'HOME', 'office': 'WORK', 'mobile': 'CELL', 'fax': 'FAX'}
    28 VCARD_PHONE_TYPES = {'home': 'HOME', 'office': 'WORK', 'mobile': 'CELL', 'fax': 'FAX'}
    31     """export a person information as a vcard"""
    31     """export a person information as a vcard"""
    32     __regid__ = 'vcard'
    32     __regid__ = 'vcard'
    33     title = _('vcard')
    33     title = _('vcard')
    34     templatable = False
    34     templatable = False
    35     content_type = 'text/x-vcard'
    35     content_type = 'text/x-vcard'
    36     __select__ = implements('CWUser')
    36     __select__ = is_instance('CWUser')
    37 
    37 
    38     def set_request_content_type(self):
    38     def set_request_content_type(self):
    39         """overriden to set a .vcf filename"""
    39         """overriden to set a .vcf filename"""
    40         self._cw.set_content_type(self.content_type, filename='vcard.vcf')
    40         self._cw.set_content_type(self.content_type, filename='vcard.vcf')
    41 
    41