- Timestamp:
- Dec 15, 2008, 12:12:08 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exodus/scripts/genesis_to_exodus.py
r6434 r6456 1 from exodus.forms import NodeForm 2 1 3 def run(): 2 4 """Import script for genesis data.""" 3 5 print """Import script for genesis.""" 6 # Please do mind to keep all the entries valid, altough some get values get updated 7 dataform ={'name' : 'Foo8', 'location' : '1', 'status' : 'up', 'network' : '1', 'masterip' : '127.0.0.1' } 8 form = NodeForm(dataform) 9 if not form.is_valid(): 10 print form._errors 11 else: 12 form.save() 13 14 # Alternative approch 15 #from django.test.client import Client 16 #c = Client() 17 #c.login(username='admin', password='bert') 18 #response = c.post('/admin/exodus/node/add', rick) 19 #if response.content.find('errorlist') != -1: 20 # print "Import failure" 4 21 pass
Note:
See TracChangeset
for help on using the changeset viewer.