catalogApp.py
def deleteCategory(category_id):
    '''
    Removes an existing category from the database.
    '''
    categoryToDelete = session.query(Category).filter_by(id=category_id).one()
    if categoryToDelete.user_id != login_session['user_id']:
        flash("You cannot delete this category. Catergories can only be \
              deleted by their owners.")
        return redirect(url_for('showCategories'))
    if request.method == 'POST':
        session.delete(categoryToDelete)
        session.commit()
        flash("You have deleted a category.")
        return redirect(url_for('showCategories'))
    else:
        return render_template('deletecategory.html',
                               category=categoryToDelete,
                               login_session=login_session)

    Removes an existing category from the database.
    
Removes an existing category from the database.
Removes an existing category from the database .
def deleteCategory(category_id):
    categoryToDelete = session.query(Category).filter_by(id=category_id).one()
    if categoryToDelete.user_id != login_session['user_id']:
        flash("You cannot delete this category. Catergories can only be \
              deleted by their owners.")
        return redirect(url_for('showCategories'))
    if request.method == 'POST':
        session.delete(categoryToDelete)
        session.commit()
        flash("You have deleted a category.")
        return redirect(url_for('showCategories'))
    else:
        return render_template('deletecategory.html',
                               category=categoryToDelete,
                               login_session=login_session)
def deleteCategory ( category_id ) : categoryToDelete = session . query ( Category ) . filter_by ( id = category_id ) . one ( ) if categoryToDelete . user_id != login_session [ 'user_id' ] : flash ( "You cannot delete this category. Catergories can only be \
              deleted by their owners." ) return redirect ( url_for ( 'showCategories' ) ) if request . method == 'POST' : session . delete ( categoryToDelete ) session . commit ( ) flash ( "You have deleted a category." ) return redirect ( url_for ( 'showCategories' ) ) else : return render_template ( 'deletecategory.html' , category = categoryToDelete , login_session = login_session )
Removes an existing category from the database.
Removes an existing category from the database .
'''
    Removes an existing category from the database.
    '''
category_id