catalogApp.py
def deleteItem(category_id, item_id):
    '''
    Removes item matching item_id from database.
    '''
    itemToDelete = session.query(Item).filter_by(id=item_id).one()
    belongsToCategory = session.query(Category).filter_by(
        id=category_id).one()
    if login_session['user_id'] != itemToDelete.user_id:
        flash("Only the owner of %s category may remove this item."
              % belongsToCategory.name)
        return redirect(url_for('showItems', category_id=category_id))
    if request.method == 'POST':
        session.delete(itemToDelete)
        session.commit()
        flash("You have removed an item in this category.")
        return redirect(url_for('showItems', category_id=category_id))
    else:
        return render_template('deleteitem.html', item=itemToDelete,
                               login_session=login_session)

    Removes item matching item_id from database.
    
Removes item matching item_id from database.
Removes item matching item_id from database .
def deleteItem(category_id, item_id):
    itemToDelete = session.query(Item).filter_by(id=item_id).one()
    belongsToCategory = session.query(Category).filter_by(
        id=category_id).one()
    if login_session['user_id'] != itemToDelete.user_id:
        flash("Only the owner of %s category may remove this item."
              % belongsToCategory.name)
        return redirect(url_for('showItems', category_id=category_id))
    if request.method == 'POST':
        session.delete(itemToDelete)
        session.commit()
        flash("You have removed an item in this category.")
        return redirect(url_for('showItems', category_id=category_id))
    else:
        return render_template('deleteitem.html', item=itemToDelete,
                               login_session=login_session)
def deleteItem ( category_id , item_id ) : itemToDelete = session . query ( Item ) . filter_by ( id = item_id ) . one ( ) belongsToCategory = session . query ( Category ) . filter_by ( id = category_id ) . one ( ) if login_session [ 'user_id' ] != itemToDelete . user_id : flash ( "Only the owner of %s category may remove this item." % belongsToCategory . name ) return redirect ( url_for ( 'showItems' , category_id = category_id ) ) if request . method == 'POST' : session . delete ( itemToDelete ) session . commit ( ) flash ( "You have removed an item in this category." ) return redirect ( url_for ( 'showItems' , category_id = category_id ) ) else : return render_template ( 'deleteitem.html' , item = itemToDelete , login_session = login_session )
Removes item matching item_id from database.
Removes item matching item_id from database .
'''
    Removes item matching item_id from database.
    '''
category_id
item_id