Hi i'm new to Python/Django and am having some real trouble wrapping my head around mapping my existing CouchDB docs.
I'm building on the Greetings demo but end up getting either KeyError exceptions or no results displayed. Here's what I've got so far:
CouchDB view:
"map
": "function(doc) { \n if (doc.header != null)\n emit(doc._id, doc); \n}"
Models.py
class Greeting(Document):
header = StringProperty()
class Meta:
app_label = "greeting"
Views.py
greetings = Greeting.view('greeting/all')
return render("home.html", {
"form": form,
"greet": greet,
"greetings": greetings
}, context_instance=RequestContext(request))
greetings seems is where I'm having the problem, it looks like it gets the results from the CouchDB view and returns the correct amount of rows, but the rows don't get mapped to the Greeting model. Any idea where I might be going wrong?