当前位置: 首页>>代码示例>>Python>>正文


Python utils.fetch_page函数代码示例

本文整理汇总了Python中webservices.utils.fetch_page函数的典型用法代码示例。如果您正苦于以下问题:Python fetch_page函数的具体用法?Python fetch_page怎么用?Python fetch_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fetch_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

 def get(self, **kwargs):
     if kwargs.get('form_type') and 'RFAI' in kwargs.get('form_type'):
         #Adds FRQ types if RFAI was requested
         kwargs.get('form_type').append('FRQ')
     query = self.build_query(**kwargs)
     count = counts.count_estimate(query, models.db.session, threshold=5000)
     return utils.fetch_page(query, kwargs, model=models.Filings, count=count, multi=True)
开发者ID:18F,项目名称:openFEC,代码行数:7,代码来源:filings.py

示例2: get

 def get(self, committee_id=None, committee_type=None, **kwargs):
     query, reports_class, reports_schema = self.get_reports(committee_id, committee_type, kwargs)
     validator = args.IndexValidator(reports_class)
     for key in kwargs['sort']:
         validator(key)
     page = utils.fetch_page(query, kwargs, model=reports_class)
     return reports_schema().dump(page).data
开发者ID:srinivasmalladi,项目名称:openFEC,代码行数:7,代码来源:reports.py

示例3: get

 def get(self, committee_id, **kwargs):
     totals_class, totals_schema = totals_schema_map.get(
         self._resolve_committee_type(committee_id, kwargs), default_schemas
     )
     totals = self.get_totals(committee_id, totals_class, kwargs)
     page = utils.fetch_page(totals, kwargs)
     return totals_schema().dump(page).data
开发者ID:LetsUnlockiPhone,项目名称:openFEC,代码行数:7,代码来源:totals.py

示例4: get

 def get(self, *args, **kwargs):
     query = self.build_query(*args, **kwargs)
     count = counts.count_estimate(query, models.db.session, threshold=5000)
     return utils.fetch_page(
         query, kwargs,
         count=count, model=self.model, join_columns=self.join_columns, aliases=self.aliases,
         index_column=self.index_column, cap=self.cap,
     )
开发者ID:adborden,项目名称:openFEC,代码行数:8,代码来源:views.py

示例5: get

 def get(self, **kwargs):
     label_columns = [
         ScheduleABySize.size,
         sa.func.sum(ScheduleABySize.total).label('total'),
     ]
     group_columns = [ScheduleABySize.size]
     _, query = candidate_aggregate(ScheduleABySize, label_columns, group_columns, kwargs)
     return utils.fetch_page(query, kwargs, cap=None)
开发者ID:mulchy,项目名称:openFEC,代码行数:8,代码来源:candidate_aggregates.py

示例6: get

 def get(self, committee_id=None, committee_type=None, **kwargs):
     query, reports_class, reports_schema = self.build_query(
         committee_id=committee_id, committee_type=committee_type, **kwargs
     )
     if kwargs["sort"]:
         validator = args.IndexValidator(reports_class)
         validator(kwargs["sort"])
     page = utils.fetch_page(query, kwargs, model=reports_class)
     return reports_schema().dump(page).data
开发者ID:evaluation-alex,项目名称:openFEC,代码行数:9,代码来源:reports.py

示例7: get

 def get(self, committee_type=None, **kwargs):
     committee_id = kwargs.get('committee_id')
     query, reports_class, reports_schema = self.build_query(
         committee_type=committee_type,
         **kwargs
     )
     if kwargs['sort']:
         validator = args.IndicesValidator(reports_class)
         validator(kwargs['sort'])
     page = utils.fetch_page(query, kwargs, model=reports_class, multi=True)
     return reports_schema().dump(page).data
开发者ID:18F,项目名称:openFEC,代码行数:11,代码来源:reports.py

示例8: get

 def get(self, committee_id, **kwargs):
     totals_class, totals_schema = totals_schema_map.get(
         self._resolve_committee_type(committee_id, kwargs),
         default_schemas,
     )
     validator = args.IndexValidator(totals_class)
     for key in kwargs['sort']:
         validator(key)
     totals = self.get_totals(committee_id, totals_class, kwargs)
     page = utils.fetch_page(totals, kwargs, model=totals_class)
     return totals_schema().dump(page).data
开发者ID:srinivasmalladi,项目名称:openFEC,代码行数:11,代码来源:totals.py

示例9: get

 def get(self, **kwargs):
     query = candidate_aggregate(
         ScheduleAByState,
         [
             ScheduleAByState.state,
             sa.func.max(ScheduleAByState.state_full).label('state_full'),
         ],
         [ScheduleAByState.state],
         kwargs,
     )
     return utils.fetch_page(query, kwargs, cap=0)
开发者ID:srinivasmalladi,项目名称:openFEC,代码行数:11,代码来源:candidate_aggregates.py

示例10: get

 def get(self, candidate_id, **kwargs):
     totals_model = totals_model_map[candidate_id[0]]
     kwargs['candidate_id'] = [candidate_id]
     rows, aggregates = self._get_aggregates(kwargs, totals_model)
     latest = self._get_latest(rows, totals_model).subquery()
     aggregates = aggregates.subquery()
     query = db.session.query(
         aggregates,
         latest,
     ).join(
         latest,
         aggregates.c.cand_id == latest.c.cand_id,
     )
     return utils.fetch_page(query, kwargs)
开发者ID:Apeder,项目名称:openFEC,代码行数:14,代码来源:candidate_aggregates.py

示例11: get

 def get(self, **kwargs):
     query = self.model.query
     query = filter_query(self.model, query, self.filter_fields, kwargs)
     query = filter_upcoming(query, self.date_column, kwargs)
     return utils.fetch_page(query, kwargs, model=self.model)
开发者ID:srinivasmalladi,项目名称:openFEC,代码行数:5,代码来源:dates.py

示例12: get

 def get(self, **kwargs):
     query = self._get_records(kwargs)
     return utils.fetch_page(query, kwargs, cap=0)
开发者ID:18F,项目名称:openFEC,代码行数:3,代码来源:elections.py

示例13: get

 def get(self, committee_id=None, candidate_id=None, cycle=None, **kwargs):
     query = self.get_committee(committee_id, candidate_id, cycle, kwargs)
     return utils.fetch_page(query, kwargs)
开发者ID:LetsUnlockiPhone,项目名称:openFEC,代码行数:3,代码来源:committees.py

示例14: get

 def get(self, **kwargs):
     query = self.build_query(**kwargs)
     return utils.fetch_page(query, kwargs, model=self.model, join_columns=self.join_columns)
开发者ID:srinivasmalladi,项目名称:openFEC,代码行数:3,代码来源:views.py

示例15: get

 def get(self, **kwargs):
     query = models.Filings.query
     query = filter_query(models.Filings, query, fields, kwargs)
     query = utils.filter_range(query, kwargs, range_fields)
     count = counts.count_estimate(query, models.db.session, threshold=5000)
     return utils.fetch_page(query, kwargs, model=models.Filings, count=count)
开发者ID:EricSchles,项目名称:openFEC,代码行数:6,代码来源:filings.py


注:本文中的webservices.utils.fetch_page函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。