예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
 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
예제 #6
0
 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