示例#1
0
文件: admin.py 项目: yihect/patchew
 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
示例#2
0
 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
示例#3
0
 def renderer(self):
     found = re.match("^[^.]*", self.name)
     return mod.get_module(found.group(0)) if found else None
示例#4
0
 def renderer_from_name(name):
     found = re.match("^[^.]*", name)
     return mod.get_module(found.group(0)) if found else None