【发布时间】:2014-11-26 14:15:44
【问题描述】:
我正在通过Extending the CMS 阅读。
我在理解一些细节方面有一些问题:
我需要创建一个插件类。例如PollPlugin。
class PollPlugin(CMSPluginBase):
model = PollPluginModel # Model where data about this plugin is saved
name = _("Poll Plugin") # Name of the plugin
render_template = "polls/plugin.html" # template to render the plugin with
def render(self, context, instance, placeholder):
context.update({'instance':instance})
return context
plugin_pool.register_plugin(PollPlugin) # register the plugin
我的问题:
- 在这种情况下
instance是什么? - 这两个插件类的目标是什么?
PollPluginModel和PollPlugin。 -
Apphook和Plugin之间的区别
感谢任何答案
【问题讨论】:
标签: django django-cms