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

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