Beispiel #1
0
 def get_context_data(self, **kwargs):
     context = super(EventTriggerView, self).get_context_data(**kwargs)
     form = kwargs.get('form')
     if form and form.is_bound:
         data = get_placeholder_data(self.event.name, **form.cleaned_data)
         context['placeholder_data'] = sorted(data.items())
     return context
Beispiel #2
0
 def get_context_data(self, **kwargs):
     context = super(EventPlaceholderDataView, self).get_context_data(
         **kwargs)
     form = kwargs.get('form')
     if form and form.is_bound:
         try:
             data = get_placeholder_data(self.event.name,
                                         **form.cleaned_data)
         except ContextProviderException as e:
             context['placeholder_data_error'] = e
         else:
             context['placeholder_data'] = sorted(data.items())
     return context