Example #1
0
 def export_contacts(self, user_id=None):
     cards = list()
     q = self.query()
     if user_id is not None:
         q = q.filter(UserContact.user_id == user_id)
     for c in q.all():
         cards.append(make_vcard(c))
     return cards
Example #2
0
 def export_contact(self, contact_id):
     c = self.get(id)
     vcf = make_vcard(c)
     return vcf