Source

cmsplugin-poll / cmsplugin_poll / cms_plugins.py

Full commit
Antoine Nguyen e2317b7 

Bertrand Bordage 101f11e 
Antoine Nguyen e2317b7 

Bertrand Bordage 101f11e 
Antoine Nguyen e2317b7 

Bertrand Bordage 49328be 
Antoine Nguyen e2317b7 


Bertrand Bordage d803c9d 
Antoine Nguyen e2317b7 

from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cmsplugin_poll.models import PollPlugin
from django.utils.translation import ugettext as _


class CMSPollPlugin(CMSPluginBase):
    model = PollPlugin
    name = _("Simple poll")
    render_template = "cmsplugin_poll/detail.html"

    def render(self, context, instance, placeholder):
        context['poll'] = instance.poll
        return context

plugin_pool.register_plugin(CMSPollPlugin)