def post(self, request, *args, **kwargs):
<EOL>form_class = self.get_form_class()<EOL>form = self.get_form(form_class)<EOL>mongo_ids = self.get_initial()['<STR_LIT>']<EOL>for form_mongo_id in form.data.getlist('<STR_LIT>'):<EOL><INDENT>for mongo_id in mongo_ids:<EOL><INDENT>if form_mongo_id == mongo_id:<EOL><INDENT>self.document.objects.get(pk=mongo_id).delete()<EOL><DEDENT><DEDENT><DEDENT>return self.form_invalid(form)<EOL>
Creates new mongoengine records.