made deletes cascade where appropriate, also fixed badge locking for deletes

Django cascades deletes by default, but SQLAlchemy apparently doesn't, so I changed this file to cascade deletes on all the relationships.