Example #1
0
 def __call__(self):
     response = self.request.response
     response.setHeader("Content-type", "text/vcard")
     filename = encode('%s.vcf' % self.context.Title())
     response.setHeader("Content-Disposition",
                        'inline; filename="%s"' % filename)
     return generate_vcard(self.context).getvalue()
Example #2
0
    def get_files(self, path_prefix=u"", recursive=True, toplevel=True):
        filename = safe_unicode('{0}.vcf'.format(self.context.getId()))

        yield (u'{0}/{1}'.format(safe_unicode(path_prefix), filename),
               generate_vcard(self.context))