示例#1
0
    def create_model(self, form):
        model = Model(self.last_id)
        self.last_id += 1

        form.populate_obj(model)
        self.created_models.append(model)
        self.all_models[model.id] = model

        return True
示例#2
0
 def update_model(self, form, model):
     form.populate_obj(model)
     self.updated_models.append(model)
     return True