def create_or_update_interests(self, interests_ids):
     self.interests = []
     objs = [Interest.get_by_id(i) for i in interests_ids]
     self.interests.extend(objs)
     db.session.commit()
Exemple #2
0
 def get_by_id(interest_id):
     interest = Interest.get_by_id(interest_id)
     return interest