Package picalo :: Package base :: Module Record :: Class Record
[show private | hide private]
[frames | no frames]

Class Record


An individual record of a Table. Individual fields in a record can be accessed via column number or name. In the table above, this is done with the following:
>>> rec1 = mytable3[0]
>>> print rec1[1]
'Bart'

>>> print rec1['Name']
'Bart'

Method Summary
  __init__(self, page, initial_data)
Called by Table's append or insert method.
  __eq__(self, other)
Compares two records.
  __get_value__(self, col, expression_backtrack)
Internal method to retrieve the value of a cell.
returns __getattr__(self, col)
Retrieves the value of a field in the record.
returns __getitem__(self, col)
Retrieves the value of a field in the record.
  __iter__(self)
Returns an iterator to this record (using the table's column order)
  __len__(self)
Returns the length of this record
  __ne__(self, other)
Returns whether two records are not equal to another
  __repr__(self)
For debugging
  __set_page__(self, page)
Sets the table page on which this record will live.
  __setattr__(self, col, value)
Sets the value of a field in the record.
  __setitem__(self, col, value)
Sets the value of a field in the record.
  __str__(self)
For debugging
  has_key(self, key)
Returns whether the record has the given column name

Method Details

__init__(self, page, initial_data=None)
(Constructor)

Called by Table's append or insert method. Do not create Records directly. page => The Picalo memory page this record is part of. initial_data => An initial list (MUST be a Python list) of data

__eq__(self, other)
(Equality operator)

Compares two records. Records can be compared with other records, dictionaries, and lists.

__get_value__(self, col, expression_backtrack)

Internal method to retrieve the value of a cell. col => The column name or index expression_backtrack => A list of expression ids that have been run so far, to catch circular formulas

__getattr__(self, col)
(Qualification operator)

Retrieves the value of a field in the record. This method allows record.colname type of access to values.
Parameters:
col - The column name or index
           (type=str)
Returns:
The value in the given field
           (type=returns)

__getitem__(self, col)
(Indexing operator)

Retrieves the value of a field in the record. This method allows record['colname'] type of access to values.
Parameters:
col - The column name or index
           (type=str)
Returns:
The value in the given field
           (type=returns)

__iter__(self)

Returns an iterator to this record (using the table's column order)

__len__(self)
(Length operator)

Returns the length of this record

__ne__(self, other)

Returns whether two records are not equal to another

__repr__(self)
(Representation operator)

For debugging

__set_page__(self, page)

Sets the table page on which this record will live. This is changed whenever the record is added to the table for the first time or when the page it is currently on gets split into two pages.

__setattr__(self, col, value)

Sets the value of a field in the record.
Parameters:
col - The column name or index
           (type=str/int)
value - The value to save in the field
           (type=value)

__setitem__(self, col, value)
(Index assignment operator)

Sets the value of a field in the record.
Parameters:
col - The column name or index
           (type=str/int)
value - The value to save in the field
           (type=value)

__str__(self)
(Informal representation operator)

For debugging

has_key(self, key)

Returns whether the record has the given column name

Generated by Epydoc 2.1 on Mon Aug 20 05:38:17 2007 http://epydoc.sf.net