Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

Schema.find_field_name? #187

Open Jaymon opened 6 months ago

Jaymon commented 6 months ago

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.