Lookup a field by its name.
173716
def _get_field_by_name(table: LdapObjectClass, name: str) -> tldap.fields.Field:
    
    fields = table.get_fields()
    return fields[name]
1147368
def get_prep_lookup(self):
    """"""
    raise FieldError("{} '{}' does not support lookups".format(
        self.lhs.field.__class__.__name__, self.lookup_name))
718780
def get_by(self, name):
    """"""
    return next((item for item in self if item.name == name), None)
1037052
def _get_ordering_field_lookup(self, field_name):
        
        field = field_name
        get_field = getattr(self, "get_%s_ordering_field" % field_name, None)
        if get_field:
            field = get_field()
        return field
988945
def __fieldNorm(self, fieldName):
        """"""
        if len(fieldName) > 11: fieldName = fieldName[:11]
        fieldName = fieldName.upper()
        fieldName.replace(' ', '_')
1210513
def get_field_name(self, field):
        
        for field_name, f in self.fields.items():
            if f == field:
                return field_name
        raise AttributeError("Field %s does not exists in %s resource" % (
            field, self.__class__))
659261
def __check_field(self, key):
        """"""
        if not self._props.get(key):
            raise KeyError(
                'The field "%s" does not exist on "%s"' % (
                    key, self.__class__.__name__,
                ),
            )
679656
Field getField(String name)
    {       
        FieldInfo info=getFieldInfo(name);
        return getField(info,true);
    }
1042441
def _index_by_name(self, name):
        """"""
        for i, t in enumerate(self._cache):
            if t[2] == name:
                return i
            # END found item
        # END for each item in cache
        return -1
1252667
def wheregreater(self, fieldname, value):
        
        return self.mask([elem > value for elem in self[fieldname]])
250269
def get_field_mro(cls, field_name):
    """"""
    res = set()
    if hasattr(cls, '__mro__'):
        for _class in inspect.getmro(cls):
            values_ = getattr(_class, field_name, None)
            if values_ is not None:
                res = res.union(set(make_list(values_)))
    return res
1069625
def lookup_field_orderable(self, field):
        
        try:
            self.model._meta.get_field_by_name(field)
            return True
        except Exception:
            # that field doesn't exist, so not sortable
            return False
1045044
def find_by_index(self, cls, index_name, value):
        """"""
        return self._find(cls, {index_name: str(value)})
1361888
def lookup(cls, name):
        
        try:
            field = cls.FIELDS[name]
        except KeyError:
            # Is it a custom attribute?
            field = TorrentProxy.add_manifold_attribute(name)

        return {"matcher": field._matcher} if field else None
1072582
def find(self, fieldname):
        
        tablename, _, column = fieldname.rpartition(':')
        if tablename and tablename in self._field_map[column]:
            return tablename
        else:
            return self._field_map[fieldname]
663464
def _name_lookup(names):
    """
    mapper = dict(zip(range(len(names)), names))

    def lookup(val):
        return mapper.get(val, 'Unknown')
    return lookup
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)