1from django.http import HttpResponse
2
3def model_documentation(models_module, model_names):
4    doc = '<h2>Models</h2>\n'
5    for model_name in model_names:
6        model_class = getattr(models_module, model_name)
7        doc += '<h3>%s</h3>\n' % model_name
8        doc += '<pre>\n%s</pre>\n' % model_class.__doc__
9    return HttpResponse(doc)
10