def delete(self):
with db.session.begin_nested():<EOL><INDENT>Membership.query_by_group(self).delete()<EOL>GroupAdmin.query_by_group(self).delete()<EOL>GroupAdmin.query_by_admin(self).delete()<EOL>db.session.delete(self)<EOL><DEDENT>
Delete a group and all associated memberships.