def delete(request, lm_id): lm = LM.objects.get(id=lm_id) files.remove_file(files.arpa_file_path(lm)) files.remove_file(files.lm_file_path(lm)) lm.delete() return HttpResponseRedirect(reverse("lm:index"))
def arpa_file(self): path = files.arpa_file_path(self) return files.file_contents(path)