Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    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)
Example #4
0
    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')
Example #5
0
    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")
Example #6
0
    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)
Example #7
0
    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)
Example #8
0
    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)
Example #9
0
    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)
Example #10
0
 def index(self):
     c.fulfilment_type_collection = FulfilmentType.find_all()
     return render('/fulfilment_type/list.mako')
Example #11
0
 def view(self, id):
     c.fulfilment_type = FulfilmentType.find_by_id(id)
     return render('/fulfilment_type/view.mako')
Example #12
0
 def __before__(self, **kwargs):
     c.can_edit = True
     c.fulfilment_types = FulfilmentType.find_all()
Example #13
0
 def index(self):
     c.fulfilment_type_collection = FulfilmentType.find_all()
     return render("/fulfilment_type/list.mako")
Example #14
0
 def view(self, id):
     c.fulfilment_type = FulfilmentType.find_by_id(id)
     return render("/fulfilment_type/view.mako")
Example #15
0
 def __before__(self, **kwargs):
     c.product_categories = ProductCategory.find_all()
     c.fulfilment_types = FulfilmentType.find_all()
     c.ceilings = Ceiling.find_all()
Example #16
0
    def __before__(self, **kwargs):
        c.can_edit = True

        c.fulfilment_type = FulfilmentType.find_all()
        c.fulfilment_status = FulfilmentStatus.find_all()
Example #17
0
 def __before__(self, **kwargs):
     c.product_categories = ProductCategory.find_all()
     c.fulfilment_types = FulfilmentType.find_all()
     c.ceilings = Ceiling.find_all()
Example #18
0
 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
Example #19
0
 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