def add_home_recommend(self, ids): from youjiao.content.models import ContentList try: query = Book.query.filter(Book.id.in_(ids)) ContentList.add_obj_to_position(query, ContentList.HOME_BOOK) except Exception as ex: if not self.handle_view_exception(ex): raise flash(u'操作失败. {}'.format(str(ex)), 'error')
def add_home_courseware(self, ids): from youjiao.content.models import ContentList try: query = Courseware.query.filter(Courseware.id.in_(ids)) ContentList.add_obj_to_position(query, ContentList.HOME_COURSEWARE) except Exception as ex: if not self.handle_view_exception(ex): raise flash(u'操作失败. {}'.format(str(ex)), 'error')