コード例 #1
0
ファイル: api.py プロジェクト: andela-tadesanya/bucketlist
    def delete(self, id):
        '''delete a bucketlist'''
        usr = g.user

        # get the bucketlist
        bl = get_bucketlist(usr, id)

        # delete the bucketlist
        db_session.delete(bl)
        db_session.commit()

        return {'message': 'bucketlist deleted'}, 200
コード例 #2
0
ファイル: api.py プロジェクト: andela-tadesanya/bucketlist
    def delete(self, id, item_id):
        '''delete a bucket list item'''
        usr = g.user
        bl = get_bucketlist(usr, id)

        # get the bucketlist item
        bl_item = get_bucketlist_item(bl, item_id)

        # delete the bucketlist item
        db_session.delete(bl_item)
        db_session.commit()

        return {'message': 'bucketlist item deleted'}, 200