本文整理汇总了Python中invenio.bibformat_engine.BibFormatObject.req方法的典型用法代码示例。如果您正苦于以下问题:Python BibFormatObject.req方法的具体用法?Python BibFormatObject.req怎么用?Python BibFormatObject.req使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类invenio.bibformat_engine.BibFormatObject
的用法示例。
在下文中一共展示了BibFormatObject.req方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_journal_template
# 需要导入模块: from invenio.bibformat_engine import BibFormatObject [as 别名]
# 或者: from invenio.bibformat_engine.BibFormatObject import req [as 别名]
"%s/journal/%s/%s/%s?ln=%s"
% (CFG_SITE_URL, journal_name, current_issue.split("/")[1], current_issue.split("/")[0], ln),
)
try:
index_page_template = get_journal_template("index", journal_name, ln)
except InvenioWebJournalTemplateNotFoundError, e:
register_exception(req=req)
return e.user_box(req)
temp_marc = """<record>
<controlfield tag="001">0</controlfield>
</record>"""
# create a record and get HTML back from bibformat
user_info = collect_user_info(req)
bfo = BibFormatObject(0, ln=ln, xml_record=temp_marc, user_info=user_info)
bfo.req = req
verbosity = 0
if editor:
# Increase verbosity only for editors/admins
verbosity = verbose
html = format_with_format_template(index_page_template, bfo, verbose=verbosity)
return html
def perform_request_article(req, journal_name, issue_number, ln, category, recid, editor=False, verbose=0):
"""
Central logic function for article pages.
Loads the format template for article display and displays the requested
article using BibFormat.
'Editor' mode generates edit links on the article view page and disables