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


Python Markup.join方法代码示例

本文整理汇总了Python中markupsafe.Markup.join方法的典型用法代码示例。如果您正苦于以下问题:Python Markup.join方法的具体用法?Python Markup.join怎么用?Python Markup.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在markupsafe.Markup的用法示例。


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

示例1: searchform

# 需要导入模块: from markupsafe import Markup [as 别名]
# 或者: from markupsafe.Markup import join [as 别名]
	def searchform(self):
		cursor = None

		request = self.request
		cic_view = request.viewdata.cic

		topicsearch_tag = request.matchdict.get('tag')
		model_state = request.model_state
		model_state.method = None
		model_state.schema = SearchValidators

		if not model_state.validate():
			for key in model_state.form.errors:
				del model_state.form.data[key]

		search_step = model_state.value('Step', None)
		age_group_id = model_state.value('AgeGroup', None)
		language_id = model_state.value('LNID', None)
		community_ids = [x for x in model_state.value('CMID', None) or [] if x]
		community_type = model_state.value('CMType', None)
		heading1_ids = [x for x in model_state.value('GHID', None) or [] if x]
		heading2_ids = [x for x in model_state.value('GHID_2', None) or [] if x]
		group1_ids = [x for x in model_state.value('GHID_GRP', None) or [] if x]
		group2_ids = [x for x in model_state.value('GHID_GRP_2', None) or [] if x]

		community_ids = ','.join(map(str, community_ids)) if community_ids else None
		heading1_ids = ','.join(map(str, heading1_ids)) if heading1_ids else None
		group1_ids = ','.join(map(str, group1_ids)) if group1_ids else None
		heading2_ids = ','.join(map(str, heading2_ids)) if heading2_ids else None
		group2_ids = ','.join(map(str, group2_ids)) if group2_ids else None

		log.debug('heading1_ids %s', heading1_ids)

		sql = '''
			DECLARE
				@GHIDList1 varchar(max),
				@GHIDList2 varchar(max),
				@GHGroupList1 varchar(max),
				@GHGroupList2 varchar(max),
				@CMIDList varchar(max),
				@AgeGroupID int,
				@LN_ID int,
				@ViewType int

			SET @GHIDList1 = ?
			SET @GHIDList2 = ?
			SET @GHGroupList1 = ?
			SET @GHGroupList2 = ?
			SET @CMIDList = ?
			SET @AgeGroupID = ?
			SET @LN_ID = ?
			SET @ViewType = ?

			EXEC dbo.sp_CIC_View_s_TSrch @ViewType, ?, ?, @[email protected] OUTPUT, @[email protected] OUTPUT, @[email protected] OUTPUT, @[email protected] OUTPUT, @[email protected] OUTPUT, @CMType=?, @[email protected] OUTPUT, @[email protected]_ID OUTPUT

			SELECT @GHIDList1 AS GHID, @GHIDList2 AS GHID_2, @CMIDList AS CMID, @AgeGroupID AS AgeGroup, @LN_ID AS LNID, @GHGroupList1 AS GHID_GRP, @GHGroupList2 AS GHID_GRP_2

			EXEC dbo.sp_CIC_View_s_BSrch @ViewType
			'''

		with request.connmgr.get_connection() as conn:
			cursor = conn.execute(sql, heading1_ids, heading2_ids, group1_ids, group2_ids, community_ids, age_group_id, language_id, cic_view.ViewType, topicsearch_tag, search_step, community_type)

			topicsearch = cursor.fetchone()

			cursor.nextset()

			criteria = cursor.fetchall()

			cursor.nextset()

			formitems = cursor.fetchall()

			cursor.nextset()

			headings1 = cursor.fetchall()

			cursor.nextset()

			headings2 = cursor.fetchall()

			cursor.nextset()

			communities = cursor.fetchall()

			cursor.nextset()

			agegroups = cursor.fetchall()

			cursor.nextset()

			languages = cursor.fetchall()

			cursor.nextset()

			validated_params = cursor.fetchone()

			cursor.nextset()

			search_info = cursor.fetchone()
#.........这里部分代码省略.........
开发者ID:OpenCIOC,项目名称:onlineresources,代码行数:103,代码来源:topicsearch.py


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