~smoser/ubuntu/trusty/maas/lp-1172566

« back to all changes in this revision

Viewing changes to src/maasserver/forms.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2014-04-03 13:45:02 UTC
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: package-import@ubuntu.com-20140403134502-8a6wvuqwyuekufh0
Tags: upstream-1.5+bzr2227
ImportĀ upstreamĀ versionĀ 1.5+bzr2227

Show diffs side-by-side

added added

removed removed

Lines of Context:
833
833
    default_distro_series = get_config_field('default_distro_series')
834
834
    main_archive = get_config_field('main_archive')
835
835
    ports_archive = get_config_field('ports_archive')
836
 
    cloud_images_archive = get_config_field('cloud_images_archive')
837
836
 
838
837
 
839
838
class GlobalKernelOptsForm(ConfigForm):
1512
1511
    def save(self):
1513
1512
        """Disconnect the MAC addresses from the form's network."""
1514
1513
        self.network.macaddress_set.remove(*self.get_macs())
1515
 
 
1516
 
 
1517
 
class NetworkListForm(forms.Form):
1518
 
    """Form to list networks."""
1519
 
 
1520
 
    networks = InstanceListField(
1521
 
        model_class=Network, field_name='name',
1522
 
        label="List of network names.", required=True, error_messages={
1523
 
            'invalid_list':
1524
 
            "Invalid parameter: list of node system IDs required.",
1525
 
            })
1526
 
 
1527
 
    def get_networks(self):
1528
 
        """Return the networks whose names were passed in."""
1529
 
        return self.cleaned_data.get('networks')