def _delete(self, id): c.fulfilment_type = FulfilmentType.find_by_id(id) meta.Session.delete(c.fulfilment_type) meta.Session.commit() h.flash("FulfilmentType has been deleted.") redirect_to('index', id=None)
def _delete(self, id): c.fulfilment_type = FulfilmentType.find_by_id(id) meta.Session.delete(c.fulfilment_type) meta.Session.commit() h.flash("FulfilmentType has been deleted.") redirect_to("index", id=None)
def _new(self): results = self.form_result['fulfilment_type'] c.fulfilment_type = FulfilmentType(**results) meta.Session.add(c.fulfilment_type) meta.Session.commit() h.flash("Fulfilment Type created") redirect_to(action='index', id=None)
def delete(self, id): """Delete the fulfilment_type GET will return a form asking for approval. POST requests will delete the item. """ c.fulfilment_type = FulfilmentType.find_by_id(id) return render('/fulfilment_type/confirm_delete.mako')
def delete(self, id): """Delete the fulfilment_type GET will return a form asking for approval. POST requests will delete the item. """ c.fulfilment_type = FulfilmentType.find_by_id(id) return render("/fulfilment_type/confirm_delete.mako")
def edit(self, id): c.fulfilment_type = FulfilmentType.find_by_id(id) defaults = h.object_to_defaults(c.fulfilment_type, "fulfilment_type") defaults["fulfilment_type.initial_status"] = c.fulfilment_type.initial_status_id defaults["fulfilment_type.status"] = [s.id for s in c.fulfilment_type.status] form = render("/fulfilment_type/edit.mako") return htmlfill.render(form, defaults)
def _edit(self, id): fulfilment_type = FulfilmentType.find_by_id(id) for key in self.form_result['fulfilment_type']: setattr(fulfilment_type, key, self.form_result['fulfilment_type'][key]) # update the objects with the validated form data meta.Session.commit() h.flash("The FulfilmentType has been updated successfully.") redirect_to(action='index', id=None)
def _edit(self, id): fulfilment_type = FulfilmentType.find_by_id(id) for key in self.form_result["fulfilment_type"]: setattr(fulfilment_type, key, self.form_result["fulfilment_type"][key]) # update the objects with the validated form data meta.Session.commit() h.flash("The FulfilmentType has been updated successfully.") redirect_to(action="index", id=None)
def edit(self, id): c.fulfilment_type = FulfilmentType.find_by_id(id) defaults = h.object_to_defaults(c.fulfilment_type, 'fulfilment_type') defaults['fulfilment_type.initial_status'] = c.fulfilment_type.initial_status_id defaults['fulfilment_type.status'] = [s.id for s in c.fulfilment_type.status] form = render('/fulfilment_type/edit.mako') return htmlfill.render(form, defaults)
def index(self): c.fulfilment_type_collection = FulfilmentType.find_all() return render('/fulfilment_type/list.mako')
def view(self, id): c.fulfilment_type = FulfilmentType.find_by_id(id) return render('/fulfilment_type/view.mako')
def __before__(self, **kwargs): c.can_edit = True c.fulfilment_types = FulfilmentType.find_all()
def index(self): c.fulfilment_type_collection = FulfilmentType.find_all() return render("/fulfilment_type/list.mako")
def view(self, id): c.fulfilment_type = FulfilmentType.find_by_id(id) return render("/fulfilment_type/view.mako")
def __before__(self, **kwargs): c.product_categories = ProductCategory.find_all() c.fulfilment_types = FulfilmentType.find_all() c.ceilings = Ceiling.find_all()
def __before__(self, **kwargs): c.can_edit = True c.fulfilment_type = FulfilmentType.find_all() c.fulfilment_status = FulfilmentStatus.find_all()
def _to_python(self, value, state): value = FulfilmentType.find_by_id(value, abort_404=False) if value is None: raise Invalid("Type not found") else: return value