View are not view but string

未关闭
#145 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
databases

调研方向

首先重现报告的两个失败:调用 Email.view('email/all') 时,couchdbkit/client.py 中的 ViewResults 处理,以及 couchdbkit/schema/base.py 中的数据库设置。跟踪预期响应和数据库配置,然后使用现有测试或添加一个针对性的回归测试,以确保报告的视图调用行为一致。

由索引模型根据 Issue 内容生成。

描述

emailcouchs = Email.view('email/all')
print emailcouchs
print emailcouchs.count()

so it give me this error :
<couchdbkit.client.ViewResults object at 0x1d68110>
Traceback (most recent call last):
File "saveemailpa.py", line 67, in
print emailcouchs.count()
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 973, in count
self._fetch_if_needed()
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 1004, in _fetch_if_needed
self.fetch()
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 987, in fetch
self._total_rows = self._result_cache.get('total_rows')
AttributeError: 'str' object has no attribute 'get'

the latest with pip version with

and with your instruction :

Traceback (most recent call last):
File "/home/bussiere/saveemail/testcouchdb.py", line 13, in
emailcouchs = Email.view('email/all')
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/schema/base.py",
line 585, in view
db = cls.get_db()
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/schema/base.py",
line 422, in get_db
raise TypeError("doc database required to save document")
TypeError: doc database required to save document
[Finished in 0.6s]

Regards and thanks.
Bussiere

主要语言
Python
星标
261
派生
90
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

benoitc/couchdbkit 的其他 Issue

查看 benoitc/couchdbkit 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。