• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tal.getTAL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: tableRowButtons

 def tableRowButtons(self, node):
     if node.get('system.key') == node.get('key'):
         # user has permission -> use users language
         return tal.getTAL("workflow/workflow.html",
                           {'node': node,
                            'wfstep': self,
                            'lang': node.get('system.wflanguage')},
                           macro="workflow_buttons",
                           language=node.get('system.wflanguage'))
     else:
         # use standard language of request
         return tal.getTAL("workflow/workflow.html", {'node': node, 'wfstep': self, 'lang':
                                                      getDefaultLanguage()}, macro="workflow_buttons", language=getDefaultLanguage())
开发者ID:mediatum,项目名称:mediatum,代码行数:13,代码来源:workflow.py


示例2: getAdminFieldsHTML

 def getAdminFieldsHTML(self, values={}):
     return tal.getTAL("metadata/url.html",
                       {"valuelist": values["valuelist"],
                        "icons": m_url.icons,
                        "url_targets": m_url.targets},
                       macro="fieldeditor",
                       language=values["language"])
开发者ID:mediatum,项目名称:mediatum,代码行数:7,代码来源:url.py


示例3: getSearchHTML

 def getSearchHTML(self, context):
     return tal.getTAL("metadata/dlist.html",
                       {"context": context,
                        "valuelist": filter(lambda x: x != "",
                                            self.formatValues(context))},
                       macro="searchfield",
                       language=context.language)
开发者ID:mediatum,项目名称:mediatum,代码行数:7,代码来源:dlist.py


示例4: getEditorHTML

 def getEditorHTML(self, field, value="", width=400, lock=0, language=None, required=None):
     context = Context(field, value=value, width=width, name=field.getName(), lock=lock, language=language)
     return tal.getTAL("metadata/list.html", {"context": context,
                                              "valuelist": filter(lambda x: x != "", self.formatValues(context)),
                                              "required": self.is_required(required)},
                       macro="editorfield",
                       language=language)
开发者ID:mediatum,项目名称:mediatum,代码行数:7,代码来源:list.py


示例5: getEditorHTML

    def getEditorHTML(self, field, value="", width=400, lock=0, language=None, required=None):

        # field may not be persisted as tree.Node and therefore may not have
        # an attribute "get"
        if hasattr(field, "get"):
            enable_multilang = bool(field.get('multilang'))
        else:
            enable_multilang = False

        if not language:
            language = getDefaultLanguage()

        try:
            field_node_name = field.name
        except:
            field_node_name = None

        context = {
            "lock": lock,
            "value": value,
            "width": width,
            "name": field_node_name,
            "field": field,
            "t": t,
            "ident": str(field.id),
            "current_lang": language,
            "defaultlang": language,  # not the systems default language
            "languages": [],
            "langdict": {language: value},
            "language_snipper": self.language_snipper,
            "value_is_multilang": 'single',
            "multilang_display": 'display: none',
            "enable_multilang": enable_multilang,
            "expand_multilang": False,
            "required": self.is_required(required)
        }

        if enable_multilang:
            languages = config_languages
            lang = [l for l in languages if l != language]

            langdict = self.str2dict(value)
            context.update(
                {
                    "languages": lang,
                    "langdict": langdict,
                    "value_is_multilang": {True: 'multi', False: 'single'}[self.has_language_cutter(value)],
                    "multilang_display": {True: '', False: 'display: none'}[self.has_language_cutter(value)],
                })

            if enable_multilang and self.has_language_cutter(value):
                context["expand_multilang"] = True
            else:
                context["expand_multilang"] = False

        return tal.getTAL("metadata/memo.html",
                          context,
                          macro="editorfield",
                          language=language)
开发者ID:agromsl,项目名称:mediatum,代码行数:59,代码来源:memo.py


示例6: getSearchHTML

 def getSearchHTML(self, context):
     n = context.collection
     valuelist = n.getAllAttributeValues(context.field.getName(), context.access)
     locale.setlocale(locale.LC_COLLATE, '')
     v = []
     for key in sorted(valuelist.keys(), cmp=locale.strcoll):
         v.append((key, valuelist[key]))
     return tal.getTAL("metadata/ilist.html", {"context": context, "valuelist": v}, macro="searchfield", language=context.language)
开发者ID:agromsl,项目名称:mediatum,代码行数:8,代码来源:ilist.py


示例7: getEditorHTML

 def getEditorHTML(self, field, value="", width=40, lock=0, language=None, required=None):
     return tal.getTAL("metadata/label.html", {"lock": lock,
                                               "value": value,
                                               "width": width,
                                               "name": field.getName(),
                                               "field": field},
                       macro="editorfield",
                       language=language)
开发者ID:mediatum,项目名称:mediatum,代码行数:8,代码来源:label.py


示例8: getMaskEditorHTML

 def getMaskEditorHTML(self, field, metadatatype=None, language=None):
     value = ""
     try:
         if field:
             value = field.getValues()
     except AttributeError:
         value = field
     return tal.getTAL("metadata/mlist.html", {"value": value}, macro="maskeditor", language=language)
开发者ID:agromsl,项目名称:mediatum,代码行数:8,代码来源:mlist.py


示例9: getEditorHTML

 def getEditorHTML(self, field, value="", width=40, lock=0, language=None, required=None):
     try:
         values = field.get("valuelist").split(';')
     except AttributeError:
         values = field.split('\r\n')
     while len(values) < 3:
         values.append(u'')
     return tal.getTAL("metadata/hlist.html", {"lock": lock, "startnode": values[0], "attrname": values[1], "onlylast": values[2], "value": value, "width": width, "name": field.getName(), "field": field, "required": self.is_required(required)}, macro="editorfield", language=language)
开发者ID:mediatum,项目名称:mediatum,代码行数:8,代码来源:hlist.py


示例10: tableRowButtons

 def tableRowButtons(self, node):
     if node.get("system.key") == node.get("key"):
         # user has permission -> use users language
         return tal.getTAL(
             "workflow/workflow.html",
             {"node": node, "wfstep": self, "lang": node.get("system.wflanguage")},
             macro="workflow_buttons",
             language=node.get("system.wflanguage"),
         )
     else:
         # use standard language of request
         return tal.getTAL(
             "workflow/workflow.html",
             {"node": node, "wfstep": self, "lang": getDefaultLanguage()},
             macro="workflow_buttons",
             language=getDefaultLanguage(),
         )
开发者ID:hibozzy,项目名称:mediatum,代码行数:17,代码来源:workflow.py


示例11: getEditorHTML

 def getEditorHTML(self, metafield, value="", width=40, lock=0, language=None, required=None):
     return tal.getTAL("metadata/treeselect.html", {"lock": lock,
                                                    "value": value,
                                                    "width": width,
                                                    "name": metafield.getName(),
                                                    "metafield": metafield,
                                                    "required": self.is_required(required)},
                       macro="editorfield",
                       language=language)
开发者ID:mediatum,项目名称:mediatum,代码行数:9,代码来源:treeselect.py


示例12: getMaskEditorHTML

 def getMaskEditorHTML(self, field, metadatatype=None, language=None):
     try:
         value = field.getValues()
     except:
         value = ""
     #value = ""
     # if field:
     #    value = field.getValues()
     return tal.getTAL("metadata/date.html", {"value": value, "dateoption": dateoption}, macro="maskeditor", language=language)
开发者ID:agromsl,项目名称:mediatum,代码行数:9,代码来源:date.py


示例13: getMaskEditorHTML

 def getMaskEditorHTML(self, field, metadatatype=None, language=None):
     try:
         value = field.getValues().split("\r\n")
     except:
         value = []
     while len(value) < 5:
         value.append("")  # url(source), name variable, value variable
     return tal.getTAL(
         "metadata/dlist.html", {"value": value, "types": ["json", "list"]}, macro="maskeditor", language=language
     )
开发者ID:hibozzy,项目名称:mediatum,代码行数:10,代码来源:dlist.py


示例14: getEditorHTML

 def getEditorHTML(self, field, value="", width=400, lock=0, language=None, required=None):
     value = value.split(";")
     if len(value) < 2:
         value = ["", 0, "black", 0]
     return tal.getTAL("metadata/message.html", {"lock": lock,
                                                 "value": value,
                                                 "width": width,
                                                 "name": field.getName(),
                                                 "field": field,
                                                 "required": self.is_required(required)},
                       macro="editorfield",
                       language=language)
开发者ID:agromsl,项目名称:mediatum,代码行数:12,代码来源:message.py


示例15: getMaskEditorHTML

    def getMaskEditorHTML(self, field, metadatatype=None, language=None, required=None):
        try:
            values = field.get("valuelist").split(u';')
        except AttributeError:
            try:
                values = field.split(u'\r\n')
            except AttributeError:
                values = []

        while len(values) < 3:
            values.append(u'')
        return tal.getTAL("metadata/hlist.html", {"value": dict(parentnode=values[0], attrname=values[1], onlylast=values[2])}, macro="maskeditor", language=language)
开发者ID:mediatum,项目名称:mediatum,代码行数:12,代码来源:hlist.py


示例16: getEditorHTML

 def getEditorHTML(self, field, value="", width=400, lock=0, language=None, required=None):
     return tal.getTAL("metadata/number.html", {"lock": lock,
                                                "value": value,
                                                "width": width,
                                                "name": field.getName(),
                                                "field": field,
                                                "pattern": self.get_input_pattern(),
                                                "title": self.get_input_title(),
                                                "placeholder": self.get_input_placeholder(),
                                                "required": self.is_required(required)},
                       macro="editorfield",
                       language=language)
开发者ID:agromsl,项目名称:mediatum,代码行数:12,代码来源:number.py


示例17: getEditorHTML

    def getEditorHTML(self, field, value="", width=400, name="", lock=0, language=None, required=None):
        fielddef = field.getValues().split("\r\n")  # url(source), type, name variable, value variable
        if name == "":
            name = field.getName()
        while len(fielddef) < 5:
            fielddef.append("")

        valuelist = []
        try:
            if fielddef[1] == "json":
                opener = urllib2.build_opener()
                f = opener.open(urllib2.Request(fielddef[0], None, {}))
                data = json.load(f)
                data.sort(lambda x, y: cmp(x[fielddef[2]], y[fielddef[2]]))
                for item in data:
                    valuelist.append(
                        {
                            "select_text": fielddef[4]
                            .replace(fielddef[2], item[fielddef[2]])
                            .replace(fielddef[3], item[fielddef[3]]),
                            "select_value": item[fielddef[3]],
                        }
                    )
                f.close()
            elif fielddef[1] == "list":
                opener = urllib2.build_opener()
                f = opener.open(urllib2.Request(fielddef[0], None, {}))
                for item in f.read().split("\n"):
                    if not item.startswith("#"):
                        if ";" in item:
                            _v, _t = item.split(";")
                        else:
                            _v = _t = item
                        valuelist.append({"select_text": _t.strip(), "select_value": _v.strip()})
                f.close()
        except:
            # enables the field to be added without fields filled in without throwing an exception
            pass
        return tal.getTAL(
            "metadata/dlist.html",
            {
                "lock": lock,
                "name": name,
                "width": width,
                "value": value,
                "valuelist": valuelist,
                "fielddef": fielddef,
                "required": self.is_required(required),
            },
            macro="editorfield",
            language=language,
        )
开发者ID:hibozzy,项目名称:mediatum,代码行数:52,代码来源:dlist.py


示例18: getMaskEditorHTML

 def getMaskEditorHTML(self, field, metadatatype=None, language=None):
     try:
         value = field.getValues().split("\r\n")
     except AttributeError:
         value = []
     while len(value) < 4:
         value.append("")
     return tal.getTAL("metadata/url.html",
                       {"value": value,
                        "icons": m_url.icons,
                        "url_targets": m_url.targets},
                       macro="maskeditor",
                       language=language)
开发者ID:mediatum,项目名称:mediatum,代码行数:13,代码来源:url.py


示例19: getMaskEditorHTML

    def getMaskEditorHTML(self, field, metadatatype=None, language=None):
        try:
            value = field.getValues().split("\r\n")
        except:
            value = []
        while len(value) < 2:
            value.append('')

        attr = {}
        if metadatatype:
            for t in metadatatype.getDatatypes():
                node = tree.Node(type=t)
                attr.update(node.getTechnAttributes())
            attr['IPTC'] = IPTC.get_wanted_iptc_tags()

        return tal.getTAL("metadata/meta.html", {"value": value, "t_attrs": attr}, macro="maskeditor", language=language)
开发者ID:agromsl,项目名称:mediatum,代码行数:16,代码来源:meta.py


示例20: getMaskEditorHTML

    def getMaskEditorHTML(self, field, metadatatype=None, language=None, attr_dict={}):
        try:
            value = field.getValues()
        except AttributeError:
            value = u""

        context = {
            "value": value,
            "additional_attrs": ",".join(self.additional_attrs),
        }

        for attr_name in self.additional_attrs:
            context[attr_name] = ''

        context.update(attr_dict)
        return tal.getTAL("metadata/htmlmemo.html", context, macro="maskeditor", language=language)
开发者ID:mediatum,项目名称:mediatum,代码行数:16,代码来源:htmlmemo.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python db.DatabaseHandler类代码示例发布时间:2022-05-27
下一篇:
Python factories.ProjectFactory类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap