def get_model_fields(self):
"""
Method to get all model fields for the content type
associated with the forms specified content type
:return: List of model field instances
"""
def is_valid_field(field):
if isinstance(field, (models.AutoField, ForeignObjectRel, GenericRelation, GenericForeignKey)):
return False
else:
return True
return list(filter(is_valid_field, self.content_type.model_class()._meta.get_fields()))
评论列表
文章目录