Beispiel #1
0
    def delete(self):
        # delete a thing

        # TODO: authorization (who should be able to delete things ?)
        # should things be deleted at all ?
        uuids = request.POST.getall('uuid')
        things = self.thing_q.filter(Thing.uuid.in_(uuids))

        for thing in things:
            Session.delete(thing)
        Session.commit()

        for uuid in uuids:
            flash('Deleted %s.' % uuid)

        redirect_to('index_things')