Closed likeon closed 5 months ago
Glad you are open about accepting the contribution!
Sure, I'll update the README. Tests, however, I am not sure how to go about as it might require an additional database declaration in test project settings. Let me think a bit about it.
Thank you.
Unfortunately I don't have time to continue working on this one. Apologies for the noise. Feel free to close it.
Thanks for letting me know - I might add the tests and update README, if I find the time
The recommended method for positioning a view in a PostgreSQL schema other than 'public' is by using the 'db_table' attribute within the 'Meta' class:
db_table = 'my_custom_schema.preferredcustomer'
.Nevertheless, this method does not function effectively and can cause complex ORM queries to fail with an error. You can find more in-depth discussions about this issue in the following StackOverflow threads:
The topics above recommend specifying schema like that:
db_table = 'schema\".\"tablename'
. Although this approach works well with Django in the scenarios I tested, it is hacky and leads to failure in view creation when usingdjango-pgviews-redux
.This pull request aims to address the problem by altering the SQL queries generated by the package to exclude schema specification unless explicitly defined. As a result, the search_path connection option is prioritized, enabling the creation of views in the anticipated schemas.