Closed Lars closed 5 years ago
Hello @Lars, you'll need to first fetch the design document from the server:
ddoc_with_view = DesignDocument(database, '_design/vistas')
ddoc_with_view.fetch()
You can also use the recommended database helper method get_view_result
.
Thank you for your help, it is indeed, as you say.
I'm doing some dockerized code in Python (3.5) and flask (1.1.1) working against a CouchDB database (2.3.1) using the cloudant python extension (2.12.0).
I'm trying to fetch and use a view from the database, but it is not working. I can fetch documents, and work with the database normally, but I can't use the view.
I've added a print statement for the object that should hold the design document at the program start, and I see that the document shows as having no views (or anything at all) AND the CouchDB log shows NO requests for the design document being made.
I also tried to both get the design document and use the view via curl using the same URL and username/password, and both actions work successfully.
Here's sample code that fails:
In that code, the print of the design document (views) returns:
With empty views as show... And the CouchDB log only shows the login to the database and getting the DB info:
No other queries at all.
No errors in the app log either. Even when I call the routed use of the views:
And, as I said, I can get, and use the document: