def _build_form(self): """build form for model class""" exclude = self.form_exclude or [] exclude.append(get_pk_column(self.model).name) return model_form(self.model, db_session=self.session, only=self.form_only, exclude=exclude, field_args=self.form_field_args)
def get_bulk_selected(self, id_list): objects = self.session.query(self.model).filter(get_pk_column(self.model).in_(id_list)).all() return objects
def get_obj(self): pk_column = get_pk_column(self.model) obj = self.session.query(self.model).get(self.parts['obj_id']) if not obj: raise HTTPNotFound return obj
def get_bulk_selected(self, id_list): objects = self.session.query(self.model).filter( get_pk_column(self.model).in_(id_list)).all() return objects