-
Notifications
You must be signed in to change notification settings - Fork 0
/
cms_plugins.py
26 lines (21 loc) · 1003 Bytes
/
cms_plugins.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
from cms.plugin_base import CMSPluginBase
from cms.models.pluginmodel import CMSPlugin
from cms.plugin_pool import plugin_pool
from django.utils.translation import ugettext_lazy as _
from .forms import SearchForm
from django.conf import settings
from .models import HerbAcronym, Subdivision
class PrintHerbitemObjects(CMSPluginBase):
model = CMSPlugin
name = _(u"Отображение гербарных образцов")
render_template = "render_herb_plugin.html"
def render(self, context, instance, placeholder):
context.update({'searchform': SearchForm(),
'herbitem_personal_url': settings.HERBS_HERBITEM_PAGE,
'acronyms': HerbAcronym.objects.all(),
'subdivisions': Subdivision.objects.all(),
'orderings': settings.HERBS_SEARCHFORM_ORDERING_FIELDS
})
return context
plugin_pool.register_plugin(PrintHerbitemObjects)