Ejemplo n.º 1
0
    def _delete(self, id):
        c.time_slot = TimeSlot.find_by_id(id)
        meta.Session.delete(c.time_slot)
        meta.Session.commit()

        h.flash("Time Slot has been deleted.")
        redirect_to('index')
Ejemplo n.º 2
0
    def _delete(self, id):
        c.time_slot = TimeSlot.find_by_id(id)
        meta.Session.delete(c.time_slot)
        meta.Session.commit()

        h.flash("Time Slot has been deleted.")
        redirect_to('index')
Ejemplo n.º 3
0
    def delete(self, id):
        """Delete the time_slot

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.time_slot = TimeSlot.find_by_id(id)
        return render('/time_slot/confirm_delete.mako')
Ejemplo n.º 4
0
    def delete(self, id):
        """Delete the time_slot

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.time_slot = TimeSlot.find_by_id(id)
        return render('/time_slot/confirm_delete.mako')
Ejemplo n.º 5
0
    def edit(self, id):
        c.time_slot = TimeSlot.find_by_id(id)

        defaults = h.object_to_defaults(c.time_slot, 'time_slot')
        defaults['time_slot.start_date'] = c.time_slot.start_time.strftime('%d/%m/%y')
        defaults['time_slot.start_time'] = c.time_slot.start_time.strftime('%H:%M:%S')
        defaults['time_slot.end_date'] = c.time_slot.end_time.strftime('%d/%m/%y')
        defaults['time_slot.end_time'] = c.time_slot.end_time.strftime('%H:%M:%S')

        form = render('/time_slot/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 6
0
    def edit(self, id):
        c.time_slot = TimeSlot.find_by_id(id)

        defaults = h.object_to_defaults(c.time_slot, 'time_slot')
        defaults['time_slot.start_date'] = c.time_slot.start_time.strftime(
            '%d/%m/%Y')
        defaults['time_slot.start_time'] = c.time_slot.start_time.strftime(
            '%H:%M')
        defaults['time_slot.end_date'] = c.time_slot.end_time.strftime(
            '%d/%m/%Y')
        defaults['time_slot.end_time'] = c.time_slot.end_time.strftime('%H:%M')

        form = render('/time_slot/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 7
0
    def _edit(self, id):
        time_slot = TimeSlot.find_by_id(id)

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

        results = self.form_result['time_slot']
        time_slot.start_time=datetime.combine(results['start_date'], results['start_time'])
        time_slot.end_time=datetime.combine(results['end_date'], results['end_time'])

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("The Time Slot has been updated successfully.")
        redirect_to(action='index', id=None)
Ejemplo n.º 8
0
    def _edit(self, id):
        time_slot = TimeSlot.find_by_id(id)

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

        results = self.form_result['time_slot']
        time_slot.start_time = datetime.combine(results['start_date'],
                                                results['start_time'])
        time_slot.end_time = datetime.combine(results['end_date'],
                                              results['end_time'])

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("The Time Slot has been updated successfully.")
        redirect_to(action='index', id=None)
Ejemplo n.º 9
0
 def view(self, id):
     c.time_slot = TimeSlot.find_by_id(id)
     return render('/time_slot/view.mako')
Ejemplo n.º 10
0
 def view(self, id):
     c.time_slot = TimeSlot.find_by_id(id)
     return render('/time_slot/view.mako')