My favorites | Sign in
Project Home
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 199: Defect: The documentation on mappings has errors on the inlined code
1 person starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Merged:  issue 195
Owner:  ----
Closed:  Jul 6


Sign in to add a comment
 
Reported by mva.led@gmail.com, Sep 7, 2011
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()

Sep 7, 2011
#1 mva.led@gmail.com
This is a dupe of #195. Sorry.
Jul 6, 2014
Project Member #2 djc.ochtman
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 195
Sign in to add a comment

Powered by Google Project Hosting