Esempio n. 1
0
    def populate(self):
        """
        Populate the form with fields for size and plugin selection.
        """

        initial_cell_width = self.layout_cell.sizes.get("sm") or self.CELL_FULL_WIDTH

        self.fields["cell_width"] = forms.ChoiceField(
            label=_("Cell width"), choices=self.CELL_WIDTH_CHOICES, initial=initial_cell_width)

        plugin_choices = Plugin.get_plugin_choices(empty_label=_("No Plugin"))
        plugin_field = self.fields["plugin"]
        plugin_field.choices = plugin_field.widget.choices = plugin_choices
        plugin_field.initial = self.layout_cell.plugin_identifier
Esempio n. 2
0
    def populate(self):
        """
        Populate the form with fields for size and plugin selection.
        """

        initial_cell_width = self.layout_cell.sizes.get(
            "sm") or self.CELL_FULL_WIDTH

        self.fields["cell_width"] = forms.ChoiceField(
            label=_("Cell width"),
            choices=self.CELL_WIDTH_CHOICES,
            initial=initial_cell_width)

        plugin_choices = Plugin.get_plugin_choices(empty_label=_("No Plugin"))
        plugin_field = self.fields["plugin"]
        plugin_field.choices = plugin_field.widget.choices = plugin_choices
        plugin_field.initial = self.layout_cell.plugin_identifier