示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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
示例#4
0
 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)    
示例#5
0
 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)
示例#6
0
    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)
示例#7
0
 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
示例#8
0
 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"]
示例#9
0
 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"]