Returns field instance and lookup prefix for given attribute name.
        Can be overloaded in subclasses to provide filtering across multiple models.
979415
def get_field_and_lookup(self, name):
        
        name = self.get_queryset().model._meta.get_field(name)
        lookup_prefix = ''
        return name, lookup_prefix
650689
def get_fields(self):
        
        prefix = getattr(self.Meta, 'source_prefix', '')
        fields = super(ModelSubSerializer, self).get_fields()
        fields_without_prefix = OrderedDict()
        for field_name, field in fields.items():
            if field_name.startswith(prefix):
                # Set real model field name as field's `source` unless the
                # source is already explicitly set, in which case it is
                # probably a method name not the direct field name
                if not field.source:
                    field.source = field_name
                field_name = field_name[len(prefix):]
            fields_without_prefix[field_name] = field
        return fields_without_prefix
873151
def get_model_field(schema, field):
    
    if schema._declared_fields.get(field) is None:
        raise Exception("{} has no attribute {}".format(schema.__name__, field))

    if schema._declared_fields[field].attribute is not None:
        return schema._declared_fields[field].attribute
    return field
929141
def get(self, name):
        
        # read the attribute
        attr = getattr(self.context, name, None)
        if callable(attr):
            return attr()
        return attr
299653
def model_attr(attr_name):
    

    def model_attr(_value, context, **_params):
        value = getattr(context["model"], attr_name)
        return _attr(value)

    return model_attr
109208
public <V> DynamoDBMapperFieldModel<T,V> field(String attributeName) {
        return this.model.field(attributeName);
    }
140374
def model_field_attr(model, model_field, attr):
    
    fields = dict([(field.name, field) for field in model._meta.fields])
    return getattr(fields[model_field], attr)
238681
def prefix(self, name):
        
        a_node = self.adapter.get_node_attribute_node(self.impl_element, name)
        if a_node is None:
            return None
        return a_node.prefix
1359998
def prefix(cls, name):
        
        attrs = dict([(name + attr, value) for attr, value in cls.get_attrs()])
        return TreeModelMeta(
            '_'.join([name, cls.__name__]),
            (TreeModel,), attrs)
581202
def name(self):
        
        name = self.filter_.get('name')

        if name is None:
            raise InvalidFilters("Can't find name of a filter")

        if '__' in name:
            name = name.split('__')[0]

        if name not in self.schema._declared_fields:
            raise InvalidFilters("{} has no attribute {}".format(self.schema.__name__, name))

        return name
596579
def _get_extension_by_field(self, name):
        
        if name is None:
            raise TypeError("Expected field name")

        # Reuse existing lookups.
        tr_model = self.get_model_by_field(name)
        for meta in self._extensions:
            if meta.model == tr_model:
                return meta
236044
def igetattr(self, name, context=None, class_context=True):
        
        # set lookup name since this is necessary to infer on import nodes for
        # instance
        context = contextmod.copy_context(context)
        context.lookupname = name
        try:
            attr = self.getattr(name, context, class_context=class_context)[0]
            for inferred in bases._infer_stmts([attr], context, frame=self):
                # yield Uninferable object instead of descriptors when necessary
                if not isinstance(inferred, node_classes.Const) and isinstance(
                    inferred, bases.Instance
                ):
                    try:
                        inferred._proxied.getattr("__get__", context)
                    except exceptions.AttributeInferenceError:
                        yield inferred
                    else:
                        yield util.Uninferable
                else:
                    yield function_to_method(inferred, self)
        except exceptions.AttributeInferenceError as error:
            if not name.startswith("__") and self.has_dynamic_getattr(context):
                # class handle some dynamic attributes, return a Uninferable object
                yield util.Uninferable
            else:
                raise exceptions.InferenceError(
                    error.message, target=self, attribute=name, context=context
                )
1363957
def get_field_from_model_by_name(model_class, field_name):
    
    return first_match(lambda x: x if x.name == field_name else None, model_class._meta.fields)
1074491
def field_class_type_prefix(attr, options)
      if options[:as]
        options[:as].to_s.capitalize
      elsif options.has_key? :collection
        'Select'
      else
        derive_field_class_prefix attr
      end
    end
946542
def field(name, *params)
      @model.translated_attribute_names.push name.to_sym
      @model.translated_attr_accessor(name)
      @model.translation_class.field name, *params
    end
247134
def lookupBaseFieldTypeByName( fieldName )
      type = ""
      fid = lookupFieldIDByName( fieldName )
      field = lookupField( fid ) if fid
      type = field.attributes[ "base_type" ] if field
      type
   end
397124
public String findFieldName(String name, AcroFields af) {
        HashMap items = af.getFields();
        if (items.containsKey(name))
            return name;
        if (acroFieldsSom == null) {
        	if (items.isEmpty() && xfaPresent)
        		acroFieldsSom = new AcroFieldsSearch(datasetsSom.getName2Node().keySet());
        	else
        		acroFieldsSom = new AcroFieldsSearch(items.keySet());
        }
        if (acroFieldsSom.getAcroShort2LongName().containsKey(name))
            return (String)acroFieldsSom.getAcroShort2LongName().get(name);
        return acroFieldsSom.inverseSearchGlobal(Xml2Som.splitParts(name));
    }