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
def export_contact(self, contact_id): c = self.get(id) vcf = make_vcard(c) return vcf