Returns the serializer's field set.

        If `dynamic` is True, respects field inclusions/exlcusions.
        Otherwise, reverts back to standard DRF behavior.
181609
def get_fields(self):
        
        all_fields = self.get_all_fields()
        if self.dynamic is False:
            return all_fields

        if self.id_only():
            return {}

        serializer_fields = copy.deepcopy(all_fields)
        request_fields = self.request_fields
        deferred = self._get_deferred_field_names(serializer_fields)

        # apply request overrides
        if request_fields:
            for name, include in six.iteritems(request_fields):
                if name not in serializer_fields:
                    raise exceptions.ParseError(
                        '"%s" is not a valid field name for "%s".' %
                        (name, self.get_name())
                    )
                if include is not False and name in deferred:
                    deferred.remove(name)
                elif include is False:
                    deferred.add(name)

        for name in deferred:
            serializer_fields.pop(name)

        # Set read_only flags based on read_only_fields meta list.
        # Here to cover DynamicFields not covered by DRF.
        ro_fields = getattr(self.Meta, 'read_only_fields', [])
        self.flag_fields(serializer_fields, ro_fields, 'read_only', True)

        pw_fields = getattr(self.Meta, 'untrimmed_fields', [])
        self.flag_fields(
            serializer_fields,
            pw_fields,
            'trim_whitespace',
            False,
        )

        # Toggle read_only flags for immutable fields.
        # Note: This overrides `read_only` if both are set, to allow
        #       inferred DRF fields to be made immutable.
        immutable_field_names = self._get_flagged_field_names(
            serializer_fields,
            'immutable'
        )
        self.flag_fields(
            serializer_fields,
            immutable_field_names,
            'read_only',
            value=False if self.get_request_method() == 'POST' else True
        )

        return serializer_fields
355371
def dynamic_fields
      fields = []
      variant_combinations.each do |field_variants|
        FIELD_TYPES.each do |type|
          fields << DynamicField.new(type, field_variants)
        end
      end
      fields
    end
199584
def get_field_name_for(cls, field_name, dynamic_part):
        
        field = cls.get_field(field_name)
        return field.get_name_for(dynamic_part)
1358928
def get_serializer_class(self, action=None):
        
        if action is not None:
            return getattr(self, '%s_serializer_class' % action)
        else:
            return super(GenericViewSet, self).get_serializer_class()
755178
def get_fields(self, serializer_fields):
        
        fields = OrderedDict()
        for field_name, field in serializer_fields.items():
            # Skip tags field in action because it is needed only for resource creation
            # See also: WAL-1223
            if field_name == 'tags':
                continue
            info = self.get_field_info(field, field_name)
            if info:
                fields[field_name] = info
        return fields
733797
def get_fields(self):
        
        ret = OrderedDict()

        # no rights to see anything
        if not self.user:
            return ret

        # all fields that can be accessed through serializer
        fields = super(ModelPermissionsSerializer, self).get_fields()

        # superuser can see all the fields
        if self.user.is_superuser:
            return fields

        # fields that can be accessed by auhtenticated user
        allowed_fields = self._get_user_allowed_fields()
        for allowed_field in allowed_fields:
            field = fields[allowed_field.name]

            # subfields are NestedModelSerializer
            if isinstance(field, ModelPermissionsSerializer):
                # no rights on subfield's fields
                # calculate how the relation should be retrieved
                if not field.get_fields():
                    field_cls = field._related_class
                    kwargs = get_relation_kwargs(allowed_field.name,
                                                 field.info)
                    if not issubclass(field_cls,
                                      serializers.HyperlinkedRelatedField):
                        kwargs.pop('view_name', None)
                    field = field_cls(**kwargs)

            ret[allowed_field.name] = field
        return ret
980548
private int getDynamicFieldSize(Object obj, Charset charset)
            throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        int size = 0;
        for (FieldMetaData field : dynamicFieldList) {
            size = size + field.getDynamicFieldByteSize(obj, charset);
        }
        return size;
    }
1068112
def _get_fields(self, attr):
        
        ret = set()
        if "OR" in self.pieces:
            return ret
        for i in range(0, len(self.pieces), 2):
            const = self.pieces[i]
            field = getattr(const, attr)
            if field is not None:
                ret.add(field)
        return ret
1083199
private Set<Field> getItemFields() {
		Class next = Item.class;
		Set<Field> fields = new HashSet<>(getFields(next));
		while (next.getSuperclass() != Object.class) {
			next = next.getSuperclass();
			fields.addAll(getFields(next));
		}
		return fields;
	}
668668
def get_serializer_fields(self, path, method, view, version=None, method_func=None):
        
        if method in ('PUT', 'PATCH', 'POST'):
            location = 'form'
        else:
            location = 'query'

        serializer_class = self.get_serializer_class(view, method_func)
        if not serializer_class:
            return []

        serializer = serializer_class()
        if isinstance(serializer, serializers.ListSerializer):
            return [
                Field(
                    name='data',
                    location=location,
                    required=True,
                    schema=coreschema.Array()
                )
            ]

        if not isinstance(serializer, serializers.Serializer):
            return []

        fields = []
        for field in serializer.fields.values():
            if field.read_only or isinstance(field, serializers.HiddenField):
                continue

            required = field.required and method != 'PATCH'
            # if the attribute ('help_text') of this field is a lazy translation object, force it to generate a string
            description = str(field.help_text) if isinstance(field.help_text, Promise) else field.help_text
            fallback_schema = self.fallback_schema_from_field(field)
            field = Field(
                name=field.field_name,
                location=location,
                required=required,
                schema=fallback_schema if fallback_schema else field_to_schema(field),
                description=description,
            )
            fields.append(field)

        return fields
955531
def get_fields(self):
        
        fields = super(GeoModelSerializer, self).get_fields()
        # Set the geometry field name when it's undeclared.
        if not self.Meta.geom_field:
            for name, field in fields.items():
                if isinstance(field, GeometryField):
                    self.Meta.geom_field = name
                    break
        return fields
14295
def serialize(self, *fields):
        
        if fields:
            if not set(fields).issubset(self.data_nodes):
                raise SchemaError('Invalid field for serialization: {}'.format(set(fields).difference(self.data_nodes)))

            return OrderedDict([(k, getattr(self, k)) for k in fields])

        return OrderedDict([(k, getattr(self, k)) for k in self.data_nodes])
1222438
def get_field_model(name, model=None):
    
    if '.' in name:
        m, name = name.split('.')
        model = get_model(m)

    if model:
        return getattr(model, name, None), model
    else:
        return None, None
92934
def get_fields(self):
        
        field_mapping = OrderedDict()
        for field, data in self.instance.items():
            field_mapping.update(
                {field: self.facet_dict_field_class(
                    child=self.facet_list_field_class(child=self.facet_field_serializer_class(data)), required=False)}
            )

        if self.serialize_objects is True:
            field_mapping["objects"] = serializers.SerializerMethodField()

        return field_mapping
1167389
def get_composite_field_value(self, name):
        
        field = self.composite_fields[name]
        if hasattr(field, 'get_form'):
            return self.forms[name]
        if hasattr(field, 'get_formset'):
            return self.formsets[name]
264666
def _attach_to_model(self, model):
        
        if not issubclass(model, ModelWithDynamicFieldMixin):
            raise ImplementationError(
                'The "%s" model does not inherit from ModelWithDynamicFieldMixin '
                'so the "%s" DynamicField cannot be attached to it' % (
                model.__name__, self.name))

        super(DynamicFieldMixin, self)._attach_to_model(model)

        if self.dynamic_version_of is not None:
            return

        if hasattr(model, self.name):
            return

        setattr(model, self.name, self)
437949
def get_field_by_name(self, name):
        

        for f in self.fields:
            if f.get_name() == name:
                return f
        return None