New issue 198 by SpaX...@gmail.com: Naming: mapping.Document conflicts with
client.Document
http://code.google.com/p/couchdb-python/issues/detail?id=198
Could we rename
mapping.Document
to
mapping.DocumentMap
to better avoid the naming confusion?
In addition, the documentation at
http://packages.python.org/CouchDB/mapping.html
says (mine emphasised)
To define a document mapping, you declare a Python class inherited from
**Document**, and add any number of Field attributes:
Please change that to
To define a document mapping, you declare a Python class inherited from
**mapping.DocumentMap**, and add any number of Field attributes:
This will probably break a lot of things, and is a breaking change, but
would be nice to see.
I don't really think the name should be changed. However, IMO, the
documentation is not really helpful in this regards. There should be a
topic on What's the difference between couchdb.client.Document and
couchdb.mapping.Document.
This a rather confusing thing at first. Since we may expect some unique
interface to Documents. However, this is a feature I really appreciate:
mappings are designed to cover specific use cases; and not all possible
uses cases. So, having a simple/direct interface to CouchDB json documents
as dicts is really useful thing.
Best regards,
Manuel.
Thanks Manuel. Even if it's a documentation update, I would greatly
appreciate it, as I lost an hour today trying to figure out why my Document
(from couchdb import Document, who knew?) didn't inherit from the right
methods, and I saw iterkeys()...