jur9526 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

Defect: The documentation on mappings has errors on the inlined code #199

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Copy and paste the examples from the mapping.html in the interpreter 
(removing, of course, the leading >>> and ...)

What is the expected output? What do you see instead?

A working example. 
An error, NameError: name 'Document' is not defined

What version of the product are you using? On what operating system?

A clone from hg. Debian Wheezy.

Please provide any additional information below.

This is easily fixed:

diff -r 77f4db4628bf couchdb/mapping.py
--- a/couchdb/mapping.py    Sat Jun 04 17:32:53 2011 +0100
+++ b/couchdb/mapping.py    Wed Sep 07 08:33:18 2011 -0400
@@ -15,7 +15,7 @@
 To define a document mapping, you declare a Python class inherited from
 `Document`, and add any number of `Field` attributes:

->>> from couchdb.mapping import TextField, IntegerField, DateField
+>>> from couchdb.mapping import Document, TextField, IntegerField, DateField
 >>> class Person(Document):
 ...     name = TextField()
 ...     age = IntegerField()

Original issue reported on code.google.com by mva.led@gmail.com on 7 Sep 2011 at 12:36

GoogleCodeExporter commented 9 years ago
This is a dupe of #195. Sorry.

Original comment by mva.led@gmail.com on 7 Sep 2011 at 1:26

GoogleCodeExporter commented 9 years ago

Original comment by djc.ochtman on 6 Jul 2014 at 12:10