コード例 #1
0
 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()
コード例 #2
0
 def get_all_interests() -> InterestsListDTO:
     return Interest.get_all_interests()
コード例 #3
0
 def get_by_name(name):
     interest = Interest.get_by_name(name)
     return interest
コード例 #4
0
 def create(interest_name):
     interest_model = Interest(name=interest_name)
     interest_model.create()
     return interest_model.as_dto()
コード例 #5
0
 def get_by_id(interest_id):
     interest = Interest.get_by_id(interest_id)
     return interest