def initialize(self): super(SourcePackageRecipeAddView, self).initialize() widget = self.widgets['use_ppa'] current_value = widget._getFormValue() self.use_ppa_existing = render_radio_widget_part( widget, EXISTING_PPA, current_value) self.use_ppa_new = render_radio_widget_part( widget, CREATE_NEW, current_value) archive_widget = self.widgets['daily_build_archive'] self.show_ppa_chooser = len(archive_widget.vocabulary) > 0 if not self.show_ppa_chooser: self.widgets['ppa_name'].setRenderedValue('ppa') # Force there to be no '(nothing selected)' item in the select. # We do this as the input isn't listed as 'required' otherwise # the validator gets all confused when we want to create a new # PPA. archive_widget._displayItemForMissingValue = False
def initialize(self): super(SourcePackageRecipeAddView, self).initialize() widget = self.widgets['use_ppa'] current_value = widget._getFormValue() self.use_ppa_existing = render_radio_widget_part( widget, EXISTING_PPA, current_value) self.use_ppa_new = render_radio_widget_part(widget, CREATE_NEW, current_value) archive_widget = self.widgets['daily_build_archive'] self.show_ppa_chooser = len(archive_widget.vocabulary) > 0 if not self.show_ppa_chooser: self.widgets['ppa_name'].setRenderedValue('ppa') # Force there to be no '(nothing selected)' item in the select. # We do this as the input isn't listed as 'required' otherwise # the validator gets all confused when we want to create a new # PPA. archive_widget._displayItemForMissingValue = False
def setUpWidgets(self): """See `LaunchpadFormView`.""" super(BaseSnapEditView, self).setUpWidgets() widget = self.widgets.get('vcs') if widget is not None: current_value = widget._getFormValue() self.vcs_bzr_radio, self.vcs_git_radio = [ render_radio_widget_part(widget, value, current_value) for value in (VCSType.BZR, VCSType.GIT)]
def setUpWidgets(self): """See `LaunchpadFormView`.""" super(ProductSeriesSetBranchView, self).setUpWidgets() widget = self.widgets['rcs_type'] vocab = widget.vocabulary current_value = widget._getFormValue() self.rcs_type_cvs = render_radio_widget_part( widget, vocab.CVS, current_value, 'CVS') self.rcs_type_svn = render_radio_widget_part( widget, vocab.BZR_SVN, current_value, 'SVN') self.rcs_type_git = render_radio_widget_part( widget, vocab.GIT, current_value) self.rcs_type_bzr = render_radio_widget_part( widget, vocab.BZR, current_value) self.rcs_type_emptymarker = widget._emptyMarker() widget = self.widgets['branch_type'] current_value = widget._getFormValue() vocab = widget.vocabulary (self.branch_type_link, self.branch_type_import) = [ render_radio_widget_part(widget, value, current_value) for value in (LINK_LP_BZR, IMPORT_EXTERNAL)]