When a user provides a field name that doesn't exist, Ryx raises a FieldError. It would be much more helpful to suggest the closest matching field name.
Goal: Modify the field validation logic to suggest similar field names when a FieldError is raised.
Implementation hint:
- Use Python's
difflib.get_close_matches to find the closest field names in model._meta.fields.
- Update the exception message to include: "Field 'foo' not found. Did you mean 'bar'?"
When a user provides a field name that doesn't exist, Ryx raises a
FieldError. It would be much more helpful to suggest the closest matching field name.Goal: Modify the field validation logic to suggest similar field names when a
FieldErroris raised.Implementation hint:
difflib.get_close_matchesto find the closest field names inmodel._meta.fields.