Beispiel #1
0
    def edit(self, id):
        c.rego_room = RegoRoom.find_by_id(id)

        defaults = h.object_to_defaults(c.rego_room, 'rego_room')

        form = render('rego_room/edit.mako')
        return htmlfill.render(form, defaults)
Beispiel #2
0
    def _delete(self, id):
        c.rego_room = RegoRoom.find_by_id(id)
        meta.Session.delete(c.rego_room)
        meta.Session.commit()

        h.flash("Rego room has been deleted.")
        redirect_to('index')
Beispiel #3
0
    def delete(self, id):
        """Delete the rego room

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.rego_room = RegoRoom.find_by_id(id)
        return render('rego_room/confirm_delete.mako')
Beispiel #4
0
    def _edit(self, id):
        rego_room = RegoRoom.find_by_id(id)

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

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("The room has been updated successfully.")
        redirect_to(action='view', id=id)
Beispiel #5
0
 def index(self):
     c.rego_room_collection = RegoRoom.find_all()
     return render('rego_room/list.mako')
Beispiel #6
0
 def view(self, id):
     c.rego_room = RegoRoom.find_by_id(id)
     return render('rego_room/view.mako')