Commits

Frank Becker committed 02d2813

added view map

Comments (0)

Files changed (2)

couchdb/_design/hosts/view/all/map.js

+/**
+ * Created by .
+ * User: a8
+ * Date: 5/3/11
+ * Time: 5:12 PM
+ */
+function(doc) {
+    if (doc.doc_type == "Host")
+        emit(doc._id, doc);
+}

couchdb/fill_couch.py

 Python source code - replace this with a description of the code and write
 the code below this text.
 """
-from datetime import datetime
-
 __author__ = "Frank Becker <fb@alien8.de>"
 __version__ = "$Revision: 0.0 $"
 __date__ = "$Date: YDATE $"
 __copyright__ = "Copyright (c) 2010 Frank Becker"
 __license__ = "Python"
 
+from datetime import datetime
 import couchdbkit
 
 class Host(couchdbkit.Document):
 
     return host
 
+def send_view(path):
+    """
+    send design document to db
+    """
+    couchdbkit.designer.push(path, db_connect())
+
+def get_all_hosts():
+    """
+
+    Args:
+
+
+    Returns:
+
+    """
+    return Host.view("hosts/all")
+
+def get_host_by_name(host):
+    """
+
+    Args:
+
+
+    Returns:
+
+    """
+    return Host.view("hosts/one", key=host)
+
 
 def main():
     """ main
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.