Index: /trunk/exodus/forms.py
===================================================================
--- /trunk/exodus/forms.py	(revision 6512)
+++ /trunk/exodus/forms.py	(revision 6513)
@@ -3,5 +3,6 @@
 from exodus.wllogic import free_master_ip, link_has_compat_type, \
         link_is_wireless, new_ssid, new_ssid_for_existing_interface
-from exodus.wllogic import MASTER, MANAGED, calc_subnet, network, show_addr
+from exodus.wllogic import MASTER, MANAGED, calc_subnet, network, show_addr, \
+        get_direction_choices
 from exodus.settings import AP_NETMASK
 from exodus.wlipcalc import IPCalc
@@ -55,5 +56,5 @@
                     i.ip = new_ip.ips.pop()
                     i.ssid = new_ssid(new_network, self.instance, i.iface, 
-                            i.accesspoint, i.direction)
+                            i.accesspoint, i.get_direction_display())
                     for j in (j for j in all_links if not j.id == i.pk):
                         j.ip  = new_ip.ips.pop()
@@ -288,8 +289,5 @@
                     i.save()
                 if link.accesspoint:
-                    # Need to reverse because when i.save() happens
-                    # the database might have an old ipaddress and unique==True
-                    static = link.dhcpstatic_set.all()
-                    for i in static.order_by('ipaddress').reverse():
+                    for i in link.dhcpstatic_set.all():
                         i.ipaddress = new_ip.ips.pop()
                         i.save()
@@ -319,6 +317,5 @@
                     i.netmask = netmask
                     i.save() 
-                static = link.dhcpstatic_set.all()
-                for i in static.order_by('ipaddress').reverse():
+                for i in link.dhcpstatic_set.all():
                     i.ipaddress = new_ip.ips.pop()
                     i.save()
@@ -358,5 +355,5 @@
         iface = self.cleaned_data.get('iface')
         accesspoint = self.cleaned_data.get('accesspoint')
-        direction = self.cleaned_data.get('direction')
+        direction = get_direction_choices(self.cleaned_data.get('direction'))
         link = self.cleaned_data.get('link')
         orig_ssid = self.cleaned_data.get('ssid')
Index: /trunk/exodus/models.py
===================================================================
--- /trunk/exodus/models.py	(revision 6512)
+++ /trunk/exodus/models.py	(revision 6513)
@@ -137,5 +137,5 @@
     macaddress = models.CharField(max_length=17)
     accesspoint = models.ForeignKey(Interface)
-    ipaddress = models.IPAddressField(unique=True, blank=True)
+    ipaddress = models.IPAddressField(blank=True)
 
     class Meta:
Index: /trunk/exodus/wllogic.py
===================================================================
--- /trunk/exodus/wllogic.py	(revision 6512)
+++ /trunk/exodus/wllogic.py	(revision 6513)
@@ -1,5 +1,5 @@
 # (c) Roland van Laar
 
-from exodus.models import Node, WIFI_MODE_CHOICES
+from exodus.models import Node, WIFI_MODE_CHOICES, DIRECTION_CHOICES
 from exodus.settings import MASTERIP_NETMASK, WIRELESS, COMPAT
 from math import ceil, log
@@ -9,7 +9,16 @@
 MANAGED = WIFI_MODE_CHOICES[1][0]
 
+def get_direction_choices(direction):
+    """Return the full direction given an abbreviation."""
+    l = {}
+    for i in DIRECTION_CHOICES:
+        l[i[0]]  = i[1] 
+    return l[direction]
+    
+
 def new_ssid_for_existing_interface(nic):
+    """A parser that can be called in an easier way than new_ssid."""
     return new_ssid(nic.network,nic.node, nic.iface, nic.accesspoint, 
-            nic.direction)
+            nic.get_direction_dislay())
 
 def new_ssid(network, node, iface, accesspoint=False, direction=None):
@@ -32,5 +41,4 @@
             return (ssid % (""))
 
-                
         # compensate for the first AP. First AP ssid is: ap.nodename.network
         # second AP is ap2.nodename.network
