def getViewRows(self, includeDocs, untilDate, fromDate, limit=None, resumption_token=None): params = { 'stale': 'ok', 'include_docs': includeDocs, 'endkey': h.convertToISO8601Zformat(untilDate), 'startkey': h.convertToISO8601Zformat(fromDate), } if resumption_token is not None: params['startkey'] = resumption_token['startkey'] params['endkey'] = resumption_token['endkey'] params['startkey_docid'] = resumption_token['startkey_docid'] params['skip'] = 1 if limit is not None: params['limit'] = limit import json log.debug(json.dumps(params)) return h.getView( database_url=self.db_url, view_name='_design/learningregistry-by-date/_view/docs', **params)
def list_identifiers(self, from_date, until_date): rows = self.db.view('_design/learningregistry/_view/by-date', startkey=h.convertToISO8601Zformat(from_date), endkey=h.convertToISO8601Zformat(until_date)) return_list = [] for row in rows: #ignore design docs if not row.id.startswith('_design'): yield (row.id)
def list_records(self, from_date, until_date): rows = self.db.view('_design/learningregistry/_view/by-date', startkey=h.convertToISO8601Zformat(from_date), endkey=h.convertToISO8601Zformat(until_date), include_docs=True) for row in rows: #ignore design docs if not row.id.startswith('_design'): yield row.doc
def getViewRows(self,includeDocs, untilDate,fromDate,limit=None,resumption_token=None): params = { 'stale':'ok', 'include_docs':includeDocs, 'endkey':h.convertToISO8601Zformat(untilDate), 'startkey':h.convertToISO8601Zformat(fromDate), } if resumption_token is not None: params['startkey'] = resumption_token['startkey'] params['endkey'] = resumption_token['endkey'] params['startkey_docid'] = resumption_token['startkey_docid'] params['skip'] = 1 if limit is not None: params['limit'] = limit return h.getView(database_url=self.db_url,view_name='_design/learningregistry-by-date/_view/docs',**params)
def list_identifiers(self, from_date, until_date): rows = self.db.view('_design/learningregistry/_view/by-date',startkey=h.convertToISO8601Zformat(from_date),endkey=h.convertToISO8601Zformat(until_date)) return_list = [] for row in rows: #ignore design docs if not row.id.startswith('_design'): yield (row.id)
def getViewRows(self, includeDocs, untilDate, fromDate, limit=None, resumption_token=None): params = { "stale": appConfig["couchdb.stale.flag"], "include_docs": includeDocs, "endkey": h.convertToISO8601Zformat(untilDate), "startkey": h.convertToISO8601Zformat(fromDate), } if resumption_token is not None: params["startkey"] = resumption_token["startkey"] params["endkey"] = resumption_token["endkey"] params["startkey_docid"] = resumption_token["startkey_docid"] params["skip"] = 1 if limit is not None: params["limit"] = limit import json log.debug(json.dumps(params)) return h.getView(database_url=self.db_url, view_name="_design/learningregistry-by-date/_view/docs", **params)
def list_records(self, from_date, until_date): rows = self.db.view('_design/learningregistry/_view/by-date',startkey=h.convertToISO8601Zformat(from_date),endkey=h.convertToISO8601Zformat(until_date), include_docs=True) for row in rows: #ignore design docs if not row.id.startswith('_design'): yield row.doc
def list_identifiers(self, from_date, until_date): rows = h.getView(database_url=self.db_url,view_name='_design/learningregistry/_view/by-date',startkey=h.convertToISO8601Zformat(from_date),endkey=h.convertToISO8601Zformat(until_date), stale='ok') for row in rows: yield row["id"]
def list_records(self, from_date, until_date): rows = h.getView(database_url=self.db_url,view_name='_design/learningregistry/_view/by-date',startkey=h.convertToISO8601Zformat(from_date),endkey=h.convertToISO8601Zformat(until_date), include_docs=True, stale='ok') for row in rows: yield row["doc"]