Thanks for the direction
I read up on this and this is what I needed
Ordering admin.ModelAdmin objects
I tweaked it to call a template tag
{% model_desc_from_string app model.object_name %}
Calling this
def class_for_name(module_name, class_name):
import importlib
# load the module, will raise ImportError if module cannot be loaded
m = importlib.import_module(module_name)
# get the class, will raise AttributeError if class cannot be found
c = getattr(m, class_name)
return c
@register.simple_tag()
def model_desc_from_string(module_name, class_name):
import inspect
try:
full_module_name = module_name['app_label'] + ".models"
loaded_class = class_for_name(full_module_name, class_name)
return inspect.getdoc(loaded_class)
except:
return "none"
It get the doc string of teh class and then adds that.
This code needs tidying up, but you should get the idea
Thanks
Grant