def get_fieldsets(self, request, obj=None): fs = super(ModuleAdmin, self).get_fieldsets(request, obj) if obj: po = get_module(obj.name) if po: a, b = fs[0] b["fields"].remove("name") doc = type(po).__doc__ if doc: from markdown import markdown b["description"] = markdown(doc) return fs
def renderer(self): found = re.match("^[^.]*", self.name) return mod.get_module(found.group(0)) if found else None
def renderer_from_name(name): found = re.match("^[^.]*", name) return mod.get_module(found.group(0)) if found else None