私はDjango Cmsを習得しようとしていますが、ここで私は立ち往生しています。 DjangoのCMSの公式ドキュメントの次のコード リンク内: - http://docs.django-cms.org/en/release-3.4.x/introduction/plugins.htmlこの行は何を示していますか: - Django CMSのPollPluginPublisherのmodule = _( "Polls")
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from polls_cms_integration.models import PollPluginModel
from django.utils.translation import ugettext as _
class PollPluginPublisher(CMSPluginBase):
model = PollPluginModel # model where plugin data are saved
module = _("Polls")
name = _("Poll Plugin") # name of the plugin in the interface
render_template = "polls_cms_integration/poll_plugin.html"
def render(self, context, instance, placeholder):
context.update({'instance': instance})
return context
plugin_pool.register_plugin(PollPluginPublisher) # register the plugin
私はラインモジュール= _( "投票")の使用を取得することができません
ありがとうございましたIgnacio Vazquez-Abramsありがとうございますが、 "モジュール"変数がドキュメントに記載されていないので、なぜ使用されているのかわかります。 –
いいえ、私はDjango CMSがどのように動作するのか分かりません。 –
@ShashishekharHasabnisモジュール変数は、プラグインをグループ化する場所をCMSに指示します。たとえば、プラグインがたくさんあるアプリをお持ちの場合、これらのプラグインを特定の名前でグループ化する必要があります。モジュールが提供されていない場合、プラグインは「Generic」という名前でグループ化されます。 – Paulo