from django.db.models.loading import get_model
def getmodelfield(appname,modelname):
modelobj = get_model(appname,modelname)
fielddic={}
for field in modelobj._meta.fields:
fielddic[field.name] = field.verbose_name
return fielddic
原文地址:http://961911.blog.51cto.com/951911/1587812