(model_class)
django-custom-fields support
django-custom-fields support
django - custom - fields support
def get_custom_fields_from_model(model_class):
    """ django-custom-fields support """
    if 'custom_field' in settings.INSTALLED_APPS:
        from custom_field.models import CustomField
        try:
            content_type = ContentType.objects.get(
                model=model_class._meta.model_name,
                app_label=model_class._meta.app_label)
        except ContentType.DoesNotExist:
            content_type = None
        custom_fields = CustomField.objects.filter(content_type=content_type)
        return custom_fields
def get_custom_fields_from_model ( model_class ) : if 'custom_field' in settings . INSTALLED_APPS : from custom_field . models import CustomField try : content_type = ContentType . objects . get ( model = model_class . _meta . model_name , app_label = model_class . _meta . app_label ) except ContentType . DoesNotExist : content_type = None custom_fields = CustomField . objects . filter ( content_type = content_type ) return custom_fields