mirror of
https://github.com/shouptech/humulus.git
synced 2026-02-03 17:19:42 +00:00
Add by-name view
This commit is contained in:
parent
a6fba3d9ac
commit
44bdfc1413
2 changed files with 3 additions and 1 deletions
|
|
@ -148,7 +148,6 @@ def put_designs():
|
||||||
for k in data:
|
for k in data:
|
||||||
doc[k] = data[k]
|
doc[k] = data[k]
|
||||||
doc['_rev'] = rev # Add the revision back
|
doc['_rev'] = rev # Add the revision back
|
||||||
print(doc)
|
|
||||||
doc.save()
|
doc.save()
|
||||||
else:
|
else:
|
||||||
put_doc(data)
|
put_doc(data)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@
|
||||||
"views": {
|
"views": {
|
||||||
"by-date": {
|
"by-date": {
|
||||||
"map": "function (doc) {\n if (doc.$type == \"recipe\" && doc.created && doc.name) {\n emit(doc.created, doc.name)\n }\n}"
|
"map": "function (doc) {\n if (doc.$type == \"recipe\" && doc.created && doc.name) {\n emit(doc.created, doc.name)\n }\n}"
|
||||||
|
},
|
||||||
|
"by-name": {
|
||||||
|
"map": "function (doc) {\n if (doc.$type == \"recipe\" && doc.name) {\n emit(doc.name, doc.name)\n }\n}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lists": {},
|
"lists": {},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue