equal
deleted
inserted
replaced
4 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
4 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 """ |
6 """ |
7 __docformat__ = "restructuredtext en" |
7 __docformat__ = "restructuredtext en" |
8 |
8 |
|
9 from cubicweb.selectors import implements |
9 from cubicweb.common.view import EntityView |
10 from cubicweb.common.view import EntityView |
10 |
11 |
11 _ = unicode |
12 _ = unicode |
12 |
13 |
13 VCARD_PHONE_TYPES = {'home': 'HOME', 'office': 'WORK', 'mobile': 'CELL', 'fax': 'FAX'} |
14 VCARD_PHONE_TYPES = {'home': 'HOME', 'office': 'WORK', 'mobile': 'CELL', 'fax': 'FAX'} |
16 """export a person information as a vcard""" |
17 """export a person information as a vcard""" |
17 id = 'vcard' |
18 id = 'vcard' |
18 title = _('vcard') |
19 title = _('vcard') |
19 templatable = False |
20 templatable = False |
20 content_type = 'text/x-vcard' |
21 content_type = 'text/x-vcard' |
21 accepts = ('EUser',) |
22 __selectors__ = implements('EUser') |
22 |
|
23 |
23 |
24 def set_request_content_type(self): |
24 def set_request_content_type(self): |
25 """overriden to set a .vcf filename""" |
25 """overriden to set a .vcf filename""" |
26 self.req.set_content_type(self.content_type, filename='vcard.vcf') |
26 self.req.set_content_type(self.content_type, filename='vcard.vcf') |
27 |
27 |