0
私は、管理者のプラグインのタイトルをその子供のタイトルに変更したいと思います。タイトルをit'sとして 私はそれをプラグインを確認したいが、真のショーの場合、子供、タイトルを持っていますdjango-cms adminで使用するための子プラグインからタイトルを取得するには?
私はこれまで来た:
class ParentClass(CMSPlugin):
def __unicode__(self):
inner_content = ""
if ... >= 1:
for child in children:
inner_content += child.title
else:
inner_content = "empty"
return unicode(inner_content)
class ChildClass(CMSPlugin):
title = "X"
はこの可能のようなものですか?
はありがとうございます。 'デフ__unicode __(自己): inner_content = [] をself.child_plugin_instancesがNoneでない場合:self.child_plugin_instancesに子供のため : inner_content.append(子私はそれを変更し、右の出力を得たことを確認するために、 .__ unicode __()) inner_content = '、' .join(inner_content)または「空」 return str(inner_content) ' –