You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we currently have get_pk() that acts as an alias for Query.is_pk(pk).one() but we should generic that, so you can do it for any field, the get_* version would return an iterator, and the one_* version would return the first match
The text was updated successfully, but these errors were encountered:
Another approach would be to have get_<FIELDNAME> check the <FIELDNAME> against all the aliases and if it gets it then it would run one() against that field name.
If it didn't find it would check if the last character was an s, if it is it would strip it and do the check again, but use in_<FIELDNAME> to build the query instead.
If the endswith("s") check failed then it would try endswith("es") and do the same as above.
So we currently have
get_pk()
that acts as an alias forQuery.is_pk(pk).one()
but we should generic that, so you can do it for any field, theget_*
version would return an iterator, and theone_*
version would return the first matchThe text was updated successfully, but these errors were encountered: