本文整理汇总了Python中models.Author._make方法的典型用法代码示例。如果您正苦于以下问题:Python Author._make方法的具体用法?Python Author._make怎么用?Python Author._make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Author
的用法示例。
在下文中一共展示了Author._make方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __get_expanded_tuples
# 需要导入模块: from models import Author [as 别名]
# 或者: from models.Author import _make [as 别名]
def __get_expanded_tuples(inner_table):
sql = """
with ids as ({0})
select a.id, a.name, a.affiliation,
pa.authorid, pa.paperid, pa.name, pa.affiliation,
p.id, p.title, p.year, p.keyword,
c.id, c.shortname, c.fullname,
j.id, j.shortname, j.fullname
from ids
inner join paperauthor pa on ids.authorid = pa.authorid and ids.paperid = pa.paperid
inner join author a on pa.authorid = a.id
inner join paper p on pa.paperid = p.id
left join conference c on p.conferenceid = c.id
left join journal j on p.journalid = j.id
""".format(inner_table)
build_from_row = lambda r: Expanded(author=Author._make(r[0:3]) if r[0] else None,
paperauthor=PaperAuthor._make(r[3:7]) if r[3] and r[4] else None,
paper=Paper._make(r[7:11]) if r[7] else None,
conference=Conference._make(r[11:14]) if r[11] else None,
journal=Journal._make(r[14:17]) if r[14] else None)
return [build_from_row(r) for r in __execute_sql(sql)]