2010-03-25 01:59:20 |
José Ernesto Dávila Pantoja |
description |
It would be a great feature to be able to show a DesktopCouch View instead of a RecordType in a CouchGrid. Right now you can do this:
keys = ["nombre", "email", "distro"]
record_type = "http://people.ubuntu.com/~josernestodavila/couch/PizzaBashLogDoc"
self.couchgrid = CouchGrid("pizzabashlog", record_type = record_type, keys = keys)
self.couchgrid.show()
I would like to do something like:
if not self.database.view_exists("asistencia_mensual", "pizzabashlog"):
viewfn = 'function (doc){ emit([doc.mes], doc);}'
self.database.add_view("asistencia_mensual", viewfn, None, "pizzabashlog")
results = self.database.execute_view("asistencia_mensual", "pizzabashlog")
keys = ["nombre", "email", "distro"]
record_type = "http://people.ubuntu.com/~josernestodavila/couch/PizzaBashLogDoc"
self.couchgrid = CouchGrid("pizzabashlog", record_type = record_type, keys = keys, records = results)
self.couchgrid.show()
There should be a better way to pass the results to the CouchGrid, but I just started with Python and I'm not pretty sure the right way to implement it. |
It would be a great feature to be able to show a DesktopCouch View instead of a RecordType in a CouchGrid. Right now you can do this:
keys = ["nombre", "email", "distro"]
record_type = "http://people.ubuntu.com/~josernestodavila/couch/PizzaBashLogDoc"
self.couchgrid = CouchGrid("pizzabashlog", record_type = record_type, keys = keys)
self.couchgrid.show()
I would like to do something like:
if not self.database.view_exists("asistencia_mensual", "pizzabashlog"):
viewfn = 'function (doc){ emit([doc.mes], doc);}'
self.database.add_view("asistencia_mensual", viewfn, None, "pizzabashlog")
results = self.database.execute_view("asistencia_mensual", "pizzabashlog")
keys = ["nombre", "email", "distro"]
record_type = "http://people.ubuntu.com/~josernestodavila/couch/PizzaBashLogDoc"
self.couchgrid = CouchGrid("pizzabashlog", record_type = record_type, keys = keys, records = results)
self.couchgrid.show()
There should be a better way to pass the results to the CouchGrid, but I just started with Python and I'm not pretty sure the right way to implement it, maybe passing the View name instead of the record_type and not passing the extra parameter to the constructor. |
|