Changeset 6434


Ignore:
Timestamp:
Dec 10, 2008, 7:10:22 PM (16 years ago)
Author:
roland
Message:

Work in progress for interface forms.

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r6431 r6434  
    5555        @./bin/test
    5656
     57genesis:
     58# import data from exodus
     59        @./bin/django runscript genesis_to_exodus
     60
    5761new: clean debug-init debug
    5862#Fresh start, with new datebase which include debugging code
  • trunk/exodus/admin.py

    r6431 r6434  
    44from django import forms
    55from exodus.models import *
    6 from exodus.forms import NodeForm
     6from exodus.forms import NodeForm, InterfaceForm
    77from exodus.contrib import ReadOnlyAdminFields
    88
     
    1616class InterfaceInline(admin.TabularInline):
    1717    model = Interface
     18    form = InterfaceForm
    1819    extra = 2
    1920    fieldsets = (
     
    4142class NodeInline(admin.TabularInline):
    4243    model = Node
     44    form = NodeForm
    4345    extra = 2
     46    fieldsets = ('name', 'status', 'location', 'network')
    4447
    4548class LocationAdmin(admin.ModelAdmin):
  • trunk/exodus/forms.py

    r6433 r6434  
    11from django import forms
    2 from exodus.models import Node
     2from exodus.models import Node, Interface
    33from exodus.wllogic import free_master_ip, free_interlink_ip, add_interlink_ip
    44from exodus.contrib import ReadOnlyWidget
     
    1010
    1111    def clean_masterip(self):
    12         import pdb; pdb.set_trace() ;
    1312        new_network = self.cleaned_data.get('network')
    1413        #XXX: racing conditions with free_master_ip and save()?
     
    2423                #XXX: Need to update ipconfigurations for depending interfaces
    2524                masterip = free_master_ip(new_network)
    26         raise forms.ValidationError("Foutmelding van Rick en Roland")
    2725        return masterip       
    2826
    29     #def save(self, commit):
    30     #    # want to override this, but can't figure out how.
    31     #    super(NodeForm, self).save()
     27
     28class InterfaceForm(forms.ModelForm):
     29    class Meta:
     30        model = Interface
Note: See TracChangeset for help on using the changeset viewer.