Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema.find_field_name? #187

Open
Jaymon opened this issue Apr 17, 2024 · 0 comments
Open

Schema.find_field_name? #187

Jaymon opened this issue Apr 17, 2024 · 0 comments

Comments

@Jaymon
Copy link
Owner

Jaymon commented Apr 17, 2024

I was just in a situation where I needed to find the field name and had to do this:

field_name = schema.field_name(ref_type, "")
if not field_name:
    field_name = schema.field_model_name(
        ref_type
    )

I think there should be some schema method that just finds the name using all the methods, either find_field_name, field_find_name, or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant