NodeBox

Create visual output with Python programming code
Home Download Reference Tutorial Library Gallery About

database.Table.append()

Syntax

append(fields)

Description

Adds a new record with the given fields of data to the table. The fields can be a dictionary or a listing of parameters specifying the names of the fields and the data in that field. You don't need to supply a value for the id-field (this is a number that is automatically incremented).

Example

Add a second page to the pages table whose title is "chapter one":

db = ximport("database")
book = db.connect("book")
book.pages.append( {"title": "chapter one", "text": "...", "pagenumber": 2} )

An even easier way ot do this:

book.pages.append(title="chapter one", text="...", pagenumber=2)