本文整理汇总了Python中models.Node.title方法的典型用法代码示例。如果您正苦于以下问题:Python Node.title方法的具体用法?Python Node.title怎么用?Python Node.title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Node
的用法示例。
在下文中一共展示了Node.title方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_structureNode
# 需要导入模块: from models import Node [as 别名]
# 或者: from models.Node import title [as 别名]
def create_structureNode(long_title, text="", authors=()):
structure = Node()
structure.node_type = 'structureNode'
structure.title = long_title
structure.save()
text_obj = Text()
text_obj.node = structure
text_obj.text = text
text_obj.save()
for author in authors:
text_obj.authors.add(author)
text_obj.save()
return structure
示例2: create_textNode
# 需要导入模块: from models import Node [as 别名]
# 或者: from models.Node import title [as 别名]
def create_textNode(long_title, text="", authors=()):
text_node = Node()
text_node.node_type = Node.STRUCTURE_NODE
text_node.title = long_title
text_node.save()
text_obj = Text()
text_obj.node = text_node
text_obj.text = text
text_obj.save()
for author in authors:
text_obj.authors.add(author)
text_obj.save()
return text_node
示例3: create_slot
# 需要导入模块: from models import Node [as 别名]
# 或者: from models.Node import title [as 别名]
def create_slot(short_title):
slot = Node()
slot.node_type = 'slot'
slot.title = short_title
slot.save()
return slot