(self, model_class, field_name='', path='', path_verbose='')
return {
            'fields': fields,
            'custom_fields': custom_fields,
            'properties': properties,
            'path': path,
            'path_verbose': path_verbose,
            'app_label': app_label,
            'model': model,
        }
Get fields and meta data from a model
        :param model_class: A django model class
        :param field_name: The field name to get sub fields from
        :param path: path of our field in format
            field_name__second_field_name__ect__
        :param path_verbose: Human readable version of above
        :returns: Returns fields and meta data about such fields
            fields: Django model fields
            custom_fields: fields from django-custom-field if installed
            properties: Any properties the model has
            path: Our new path
            path_verbose: Our new human readable path
        :rtype: dict
Get fields and meta data from a model
        :param model_class: A django model class
        :param field_name: The field name to get sub fields from
        :param path: path of our field in format
            field_name__second_field_name__ect__
        :param path_verbose: Human readable version of above
        :returns: Returns fields and meta data about such fields
            fields: Django model fields
            custom_fields: fields from django-custom-field if installed
            properties: Any properties the model has
            path: Our new path
            path_verbose: Our new human readable path
        :rtype: dict
Get fields and meta data from a model : param model_class : A django model class : param field_name : The field name to get sub fields from : param path : path of our field in format field_name__second_field_name__ect__ : param path_verbose : Human readable version of above : returns : Returns fields and meta data about such fields fields : Django model fields custom_fields : fields from django - custom - field if installed properties : Any properties the model has path : Our new path path_verbose : Our new human readable path : rtype : dict
def get_fields(self, model_class, field_name='', path='', path_verbose=''):
        """ Get fields and meta data from a model
        :param model_class: A django model class
        :param field_name: The field name to get sub fields from
        :param path: path of our field in format
            field_name__second_field_name__ect__
        :param path_verbose: Human readable version of above
        :returns: Returns fields and meta data about such fields
            fields: Django model fields
            custom_fields: fields from django-custom-field if installed
            properties: Any properties the model has
            path: Our new path
            path_verbose: Our new human readable path
        :rtype: dict
        """
        fields = get_direct_fields_from_model(model_class)
        properties = get_properties_from_model(model_class)
        custom_fields = get_custom_fields_from_model(model_class)
        app_label = model_class._meta.app_label
        model = model_class

        if field_name != '':
            field = model_class._meta.get_field(field_name)
            direct = field.concrete
            if path_verbose:
                path_verbose += "::"
            # TODO: need actual model name to generate choice list (not pluralized field name)
            # - maybe store this as a separate value?
            if field.many_to_many and hasattr(field, 'm2m_reverse_field_name'):
                path_verbose += field.m2m_reverse_field_name()
            else:
                path_verbose += field.name

            path += field_name
            path += '__'
            if direct:
                new_model = field.related_model
                path_verbose = new_model.__name__.lower()
            else:  # Indirect related field
                new_model = field.related_model
                path_verbose = new_model.__name__.lower()

            fields = get_direct_fields_from_model(new_model)

            custom_fields = get_custom_fields_from_model(new_model)
            properties = get_properties_from_model(new_model)
            app_label = new_model._meta.app_label
            model = new_model

        return {
            'fields': fields,
            'custom_fields': custom_fields,
            'properties': properties,
            'path': path,
            'path_verbose': path_verbose,
            'app_label': app_label,
            'model': model,
        }
def get_fields ( self , model_class , field_name = '' , path = '' , path_verbose = '' ) : fields = get_direct_fields_from_model ( model_class ) properties = get_properties_from_model ( model_class ) custom_fields = get_custom_fields_from_model ( model_class ) app_label = model_class . _meta . app_label model = model_class if field_name != '' : field = model_class . _meta . get_field ( field_name ) direct = field . concrete if path_verbose : path_verbose += "::" # TODO: need actual model name to generate choice list (not pluralized field name) # - maybe store this as a separate value? if field . many_to_many and hasattr ( field , 'm2m_reverse_field_name' ) : path_verbose += field . m2m_reverse_field_name ( ) else : path_verbose += field . name path += field_name path += '__' if direct : new_model = field . related_model path_verbose = new_model . __name__ . lower ( ) else : # Indirect related field new_model = field . related_model path_verbose = new_model . __name__ . lower ( ) fields = get_direct_fields_from_model ( new_model ) custom_fields = get_custom_fields_from_model ( new_model ) properties = get_properties_from_model ( new_model ) app_label = new_model . _meta . app_label model = new_model return { 'fields' : fields , 'custom_fields' : custom_fields , 'properties' : properties , 'path' : path , 'path_verbose' : path_verbose , 'app_label' : app_label , 'model' : model , }