Changeset 6179 for conf


Ignore:
Timestamp:
Aug 12, 2008, 6:44:38 PM (17 years ago)
Author:
RIck van der Zwet
Message:

Configuration and code are glued into each other. First attempt to 'unglue' stuff a bit

Location:
conf
Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • conf/exodus/urls.py

    r6178 r6179  
    22
    33from django.conf.urls.defaults import *
    4 from django_exodus.exodus_01.models import *
     4from conf.exodus.models import *
    55
    66node_dict  = {
     
    1111
    1212        # views
    13         (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'exodus_01/index.html'}) ,
     13        (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'exodus/index.html'}) ,
    1414        (r'^nodelist/$', 'django.views.generic.list_detail.object_list', node_dict),
    1515        (r'^(?P<object_id>\d+)/node/$', 'django.views.generic.list_detail.object_detail', node_dict),
    1616
    1717        # config urls
    18         (r'^(?P<object_id>\d+)/dhcp.conf/$', 'django_exodus.exodus_01.views.conf_dhcp_conf'),
    19         (r'^(?P<object_id>\d+)/named.conf/$', 'django_exodus.exodus_01.views.conf_named_conf'),
    20         (r'^(?P<object_id>\d+)/rc.node.local/$', 'django_exodus.exodus_01.views.conf_rc_node_local'),
    21         (r'^(?P<object_id>\d+)/resolv.conf/$', 'django_exodus.exodus_01.views.conf_resolv_conf'),
     18        (r'^(?P<object_id>\d+)/dhcp.conf/$', 'conf.exodus.views.conf_dhcp_conf'),
     19        (r'^(?P<object_id>\d+)/named.conf/$', 'conf.exodus.views.conf_named_conf'),
     20        (r'^(?P<object_id>\d+)/rc.node.local/$', 'conf.exodus.views.conf_rc_node_local'),
     21        (r'^(?P<object_id>\d+)/resolv.conf/$', 'conf.exodus.views.conf_resolv_conf'),
    2222
    2323
    2424        # add urls
    25         (r'^addlocation/$', 'django_exodus.exodus_01.views.addlocation'),
    26         (r'^addnode/$', 'django_exodus.exodus_01.views.addnode'),
    27         (r'^addnic/$', 'django_exodus.exodus_01.views.addnic'),
    28         (r'^addinterlink/$', 'django_exodus.exodus_01.views.addinterlink'),
    29         (r'^addomni/$', 'django_exodus.exodus_01.views.addomni')
     25        (r'^addlocation/$', 'conf.exodus.views.addlocation'),
     26        (r'^addnode/$', 'conf.exodus.views.addnode'),
     27        (r'^addnic/$', 'conf.exodus.views.addnic'),
     28        (r'^addinterlink/$', 'conf.exodus.views.addinterlink'),
     29        (r'^addomni/$', 'conf.exodus.views.addomni'),
     30
     31        (r'^static/(.*)$', 'django.views.static.serve', {'document_root':
     32         '/Users/rick/svn/wleiden/code/exodus/static'}),
    3033)
  • conf/exodus/views.py

    r6178 r6179  
    88from socket import gethostname
    99
    10 from django_exodus.exodus_01.models import NIC, Node, Location, Link, LinkPool
    11 from django_exodus.exodus_01.wllogic import freemasterip, newssidname
     10from conf.exodus.models import NIC, Node, Location, Link, LinkPool
     11from conf.exodus.wllogic import freemasterip, newssidname
    1212
    1313def addlocation(request):
     
    2929            new_place = manipulator.save(new_data)
    3030
    31             return HttpResponseRedirect("/exodus_01/")
     31            return HttpResponseRedirect("/exodus/")
    3232
    3333    else:
     
    3535
    3636    form = forms.FormWrapper(manipulator, new_data, errors)
    37     return render_to_response('exodus_01/addlocation.html', {'form': form, 'new_data': new_data})
     37    return render_to_response('exodus/addlocation.html', {'form': form, 'new_data': new_data})
    3838
    3939def addnode(request):
     
    5252                        new_place = manipulator.save(new_data)
    5353
    54                         return HttpResponseRedirect("/exodus_01/")
     54                        return HttpResponseRedirect("/exodus/")
    5555
    5656        else:
     
    5858
    5959        form = forms.FormWrapper(manipulator, new_data, errors)
    60         return render_to_response('exodus_01/addnode.html', {'form': form })
     60        return render_to_response('exodus/addnode.html', {'form': form })
    6161
    6262def addnic(request):
     
    9090                        new_place = manipulator.save(new_data)
    9191
    92                         return HttpResponseRedirect("/exodus_01/")
     92                        return HttpResponseRedirect("/exodus/")
    9393
    9494        else:
     
    9696
    9797        form = forms.FormWrapper(manipulator, new_data, errors)
    98         return render_to_response('exodus_01/addnic.html', {'form': form })
     98        return render_to_response('exodus/addnic.html', {'form': form })
    9999
    100100def addinterlink(request):
     
    126126                        link1_manipulator.do_html2python(new_data)
    127127
    128                         return HttpResponseRedirect("/exodus_01/")
     128                        return HttpResponseRedirect("/exodus/")
    129129               
    130130        else:
     
    133133        form1 = forms.FormWrapper(link1_manipulator, new_data, errors)
    134134        form2 = forms.FormWrapper(link2_manipulator, new_data, errors)
    135         return render_to_response('exodus_01/addinterlink.html',{'form1':form1, 'form2':form2})
     135        return render_to_response('exodus/addinterlink.html',{'form1':form1, 'form2':form2})
    136136
    137137def addomni(request):
     
    153153        form1 = forms.FormWrapper(link_manipulator, new_data, errors)
    154154        form2 = forms.FormWrapper(linkpool_manipulator, new_data, errors)
    155         return render_to_response('exodus_01/addomni.html',{'form1':form1, 'form2':form2})
     155        return render_to_response('exodus/addomni.html',{'form1':form1, 'form2':form2})
    156156
    157157   
     
    173173                nic.wifimode = 1
    174174                nic.wifidesc = 'managed mode'
    175     t = loader.get_template('exodus_01/rc_local.txt')
     175    t = loader.get_template('exodus/rc_local.txt')
    176176    c = Context({'object': object,
    177177        })
     
    185185        object.host = gethostname()
    186186
    187         t = loader.get_template('exodus_01/rc_node_local.txt')
     187        t = loader.get_template('exodus/rc_node_local.txt')
    188188        c = Context({'object': object,
    189189            })
     
    198198        object.host = gethostname()
    199199
    200         t = loader.get_template('exodus_01/rc_node_local.txt')
     200        t = loader.get_template('exodus/rc_node_local.txt')
    201201        c = Context({'object': object, })
    202202
     
    223223
    224224        print "boek"
    225         t = loader.get_template('exodus_01/rc_node_local.txt')
     225        t = loader.get_template('exodus/rc_node_local.txt')
    226226        c = Context({'object': object,
    227227                })
  • conf/exodus/wllogic.py

    r6178 r6179  
    11# (c) Roland van Laar
    22
    3 from django_exodus.exodus_01.models import Node, Network
     3from conf.exodus.models import Node, Network
    44
    55def newssidname(node,desc):
  • conf/urls.py

    r6176 r6179  
    33
    44urlpatterns = patterns('',
    5      (r'^exodus/', include('django.exodus.urls')),
    6          (r'^site_media/(.*)$', 'django.views.static.serve', {'document_root':
    7          '/Users/roland/WL/exodus/django_media'}),
     5     (r'^exodus/', include('conf.exodus.urls')),
    86     (r'^admin/', include('django.contrib.admin.urls')),
    97
Note: See TracChangeset for help on using the changeset viewer.