doc/book/en/annexes/cookbook.rst
branchstable
changeset 2172 cf8f9180e63e
parent 1808 aa09e20dd8c0
child 2175 16d3c37c5d28
equal deleted inserted replaced
2125:19861294506f 2172:cf8f9180e63e
    68   The following script aims at loading data within a script assuming pyro-nsd is
    68   The following script aims at loading data within a script assuming pyro-nsd is
    69   running and your application is configured with ``pyro-server=yes``, otherwise
    69   running and your application is configured with ``pyro-server=yes``, otherwise
    70   you would not be able to use dbapi. ::
    70   you would not be able to use dbapi. ::
    71 
    71 
    72     from cubicweb import dbapi
    72     from cubicweb import dbapi
    73         
    73 
    74     cnx = dbapi.connection(database='instance-id', user='admin', password='admin')
    74     cnx = dbapi.connection(database='instance-id', user='admin', password='admin')
    75     cur = cnx.cursor()
    75     cur = cnx.cursor()
    76     for name in ('Personal', 'Professional', 'Computers'):
    76     for name in ('Personal', 'Professional', 'Computers'):
    77         cur.execute('INSERT Blog B: B name %s', name)
    77         cur.execute('INSERT Blog B: B name %s', name)
    78     cnx.commit()
    78     cnx.commit()
    79 
    79 
    80     
    80