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

_safe_join fails when models have special characters in db_table #913

Open
rouse-billy-herren opened this issue Jun 27, 2022 · 2 comments
Open

Comments

@rouse-billy-herren
Copy link

Summary

Calls to _safe_join() fail when used on a model with a Meta.db_table value that contains characters that are not valid in a python identifier.

Scenario

When using Postgres as a database back end, it's not uncommon to use schema_name"."table_name when defining model db_table values to take advantage of Postgres schema features.

Models using this method cause an error when generating a temporary annotation name in _safe_join().

Suggested Solution

I believe normalizing the db_table name, and using a static prefix to avoid conflicts, should resolve the issue.

I can put together a PR to address this - is it something you would consider merging?

@way-dave
Copy link
Contributor

way-dave commented Jul 7, 2022

Absolutely! Please hit me up!

Sorry for the delay, I've been a bit busy :)

@etianen
Copy link
Owner

etianen commented Jul 7, 2022 via email

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

3 participants