Not sure if is still being maintained but in schema.py there is a discrepancy with related names and how we get fields for autocomplete here.
_meta.get_fields will return related names in addition to the model fields.
def get_fields(self, model):
"""
By default, returns all field names of a given model.
Override this method to limit field options. You can either return a
plain list of field names from it, like ['id', 'name'], or call
.super() and exclude unwanted fields from its result.
"""
return sorted(
[f.name for f in model._meta.get_fields() if f.name != 'password'],
)
However when this function is used in introspect line 366:
model_fields = OrderedDict()
for field in self.get_fields(model):
if not isinstance(field, DjangoQLField):
field = self.get_field_instance(model, field)
the get_field_instance function will call meta.get_field which does not support related names. This breaks the query language search.
Not sure if is still being maintained but in
schema.py
there is a discrepancy with related names and how we get fields for autocomplete here._meta.get_fields
will return related names in addition to the model fields.However when this function is used in
introspect
line 366:the
get_field_instance
function will callmeta.get_field
which does not support related names. This breaks the query language search.I think we would need to use
get_attr
or make sure we handle related names