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
时间: 2024-11-09 01:55:02