本文整理汇总了Python中pyasm.search.SearchType.get_database_impl_by_search_type方法的典型用法代码示例。如果您正苦于以下问题:Python SearchType.get_database_impl_by_search_type方法的具体用法?Python SearchType.get_database_impl_by_search_type怎么用?Python SearchType.get_database_impl_by_search_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.search.SearchType
的用法示例。
在下文中一共展示了SearchType.get_database_impl_by_search_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init
# 需要导入模块: from pyasm.search import SearchType [as 别名]
# 或者: from pyasm.search.SearchType import get_database_impl_by_search_type [as 别名]
#.........这里部分代码省略.........
# if there is a layout view, then find the element names using that
layout_view = my.kwargs.get("layout_view")
if layout_view:
layout_view = layout_view.replace("/", ".")
search = Search("config/widget_config")
search.add_filter("view", layout_view)
layout_config = search.get_sobject()
xml = layout_config.get_xml_value("config")
my.element_names = xml.get_values("config//html//element/@name")
else:
my.element_names = my.config.get_element_names()
ignore = my.kwargs.get("ignore")
if isinstance(ignore, basestring):
ignore = ignore.split("|")
if not ignore:
ignore = []
my.element_titles = []
my.element_descriptions = []
for element_name in my.element_names:
my.element_titles.append( my.config.get_element_title(element_name) )
my.element_descriptions.append( my.config.get_element_description(element_name) )
#my.element_titles = my.config.get_element_titles()
#my.element_descriptions = my.config.get_element_descriptions()
# MongoDb
# Default columns
if not my.element_names:
impl = SearchType.get_database_impl_by_search_type(my.search_type)
if impl.get_database_type() == "MongoDb":
my.element_names = impl.get_default_columns()
my.element_titles = ['Code', 'Name', 'Description']
my.element_descriptions = ['Code', 'Name', 'Description']
my.input_prefix = my.kwargs.get('input_prefix')
if not my.input_prefix:
my.input_prefix = 'edit'
security = Environment.get_security()
default_access = "edit"
project_code = Project.get_project_code()
for i, element_name in enumerate(my.element_names):
if element_name in ignore:
my.skipped_element_names.append(element_name)
continue
# check security access
access_key2 = {
'search_type': my.search_type,
'project': project_code
}
access_key1 = {
'search_type': my.search_type,
'key': element_name,