Changeset 6456 for trunk


Ignore:
Timestamp:
Dec 15, 2008, 12:12:08 AM (16 years ago)
Author:
RIck van der Zwet
Message:

Running using, basic sample code
$ ./bin/django runscript genesis_to_exodus

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/exodus/scripts/genesis_to_exodus.py

    r6434 r6456  
     1from exodus.forms import NodeForm
     2
    13def run():
    24    """Import script for genesis data."""
    35    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"
    421    pass
Note: See TracChangeset for help on using the changeset viewer.