Пример #1
0
    def _delete(self, id):
        c.fulfilment_status = FulfilmentStatus.find_by_id(id)
        meta.Session.delete(c.fulfilment_status)
        meta.Session.commit()

        h.flash("Fulfilment Status has been deleted.")
        redirect_to('index', id=None)
Пример #2
0
    def _delete(self, id):
        c.fulfilment_status = FulfilmentStatus.find_by_id(id)
        meta.Session.delete(c.fulfilment_status)
        meta.Session.commit()

        h.flash("Fulfilment Status has been deleted.")
        redirect_to('index', id=None)
Пример #3
0
    def edit(self, id):
        c.fulfilment_status = FulfilmentStatus.find_by_id(id)

        defaults = h.object_to_defaults(c.fulfilment_status, 'fulfilment_status')
        defaults['fulfilment_status.types'] = [t.id for t in c.fulfilment_status.types]

        form = render('/fulfilment_status/edit.mako')
        return htmlfill.render(form, defaults)
Пример #4
0
    def edit(self, id):
        c.fulfilment_status = FulfilmentStatus.find_by_id(id)

        defaults = h.object_to_defaults(c.fulfilment_status, 'fulfilment_status')
        defaults['fulfilment_status.types'] = [t.id for t in c.fulfilment_status.types]

        form = render('/fulfilment_status/edit.mako')
        return htmlfill.render(form, defaults)
Пример #5
0
    def delete(self, id):
        """Delete the fulfilment_status

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.fulfilment_status = FulfilmentStatus.find_by_id(id)
        return render('/fulfilment_status/confirm_delete.mako')
Пример #6
0
    def delete(self, id):
        """Delete the fulfilment_status

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.fulfilment_status = FulfilmentStatus.find_by_id(id)
        return render('/fulfilment_status/confirm_delete.mako')
Пример #7
0
    def _edit(self, id):
        fulfilment_status = FulfilmentStatus.find_by_id(id)

        for key in self.form_result['fulfilment_status']:
            setattr(fulfilment_status, key, self.form_result['fulfilment_status'][key])

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("The Fulfilment Status has been updated successfully.")
        redirect_to(action='index', id=None)
Пример #8
0
    def _edit(self, id):
        fulfilment_status = FulfilmentStatus.find_by_id(id)

        for key in self.form_result['fulfilment_status']:
            setattr(fulfilment_status, key, self.form_result['fulfilment_status'][key])

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("The Fulfilment Status has been updated successfully.")
        redirect_to(action='index', id=None)
Пример #9
0
 def _to_python(self, value, state):
     value = FulfilmentStatus.find_by_id(value, abort_404=False)
     if value is None:
         raise Invalid('Status not found')
     else:
         return value
Пример #10
0
 def view(self, id):
     c.fulfilment_status = FulfilmentStatus.find_by_id(id)
     return render('/fulfilment_status/view.mako')
Пример #11
0
 def view(self, id):
     c.fulfilment_status = FulfilmentStatus.find_by_id(id)
     return render('/fulfilment_status/view.mako')
Пример #12
0
 def _to_python(self, value, state):
     value = FulfilmentStatus.find_by_id(value, abort_404=False)
     if value is None:
         raise Invalid('Status not found')
     else:
         return value