# NodeBox

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

# database.Table.edit()

## Syntax

    edit(key, fields)

## Description

Edits the record whose id is equal to key. The fields can be a dictionary or a listing of parameters specifying the names of the fields and the data to put in that field.

## Example

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

An even easier way ot do this:

    book.pages.edit(1, pagenumber=24)