Beispiel #1
0
    def get_context_data(self, **kwargs):
        context = super(BrandingManagementIndexView,
                        self).get_context_data(**kwargs)

        colour_values = get_brand_colours()
        colour_descriptions = get_available_colours()

        colours = []

        for key, value in colour_values.items():
            try:
                colours.append((value, colour_descriptions[key]))
            except KeyError:
                # We've presumably removed a colour that was once
                # defined.
                pass

        context['colours'] = colours

        return context
Beispiel #2
0
    def get_context_data(self, **kwargs):
        context = super(BrandingManagementIndexView,
                        self).get_context_data(**kwargs)

        colour_values = get_brand_colours()
        colour_descriptions = get_available_colours()

        colours = []

        for key, value in colour_values.items():
            try:
                colours.append((value, colour_descriptions[key]))
            except KeyError:
                # We've presumably removed a colour that was once
                # defined.
                pass

        context['colours'] = colours

        return context
Beispiel #3
0
 def get_initial(self):
     initial = super(BrandingManagementUpdateColoursView,
                     self).get_initial()
     initial.update(get_brand_colours())
     return initial
Beispiel #4
0
 def get_form(self, form_class):
     form = super(BrandingManagementUpdateColoursView,
                  self).get_form(form_class)
     form.initial = get_brand_colours()
     return form
Beispiel #5
0
 def get_form(self, form_class):
     form = super(BrandingManagementUpdateColoursView,
                  self).get_form(form_class)
     form.initial = get_brand_colours()
     return form
Beispiel #6
0
 def get_initial(self):
     initial = super(BrandingManagementUpdateColoursView,
                     self).get_initial()
     initial.update(get_brand_colours())
     return initial