Home | Trees | Index | Help |
|
---|
Package Pyblio :: Module Store :: Class Record |
|
object
--+ |dict
--+ | Record
A database record.
It behaves like a dictionnary, which returns a list of
attributes for each key. The attributes types depend on the database Schema
.
Record.add
to build up a Record, instead of
setting its fields manually.
Note: this class is shared by all stores
Method Summary | |
---|---|
__init__(self)
| |
Adds a new value to a field of this record. | |
deep_equal(self,
other)
| |
Get a field, understanding the dotted notation of the add method | |
Export as XML. | |
Inherited from dict | |
x.__cmp__(y) <==> cmp(x,y) | |
x.__contains__(y) <==> y in x | |
x.__delitem__(y) <==> del x[y] | |
x.__eq__(y) <==> x==y | |
x.__ge__(y) <==> x>=y | |
x.__getattribute__('name') <==> x.name | |
x.__getitem__(y) <==> x[y] | |
x.__gt__(y) <==> x>y | |
x.__hash__() <==> hash(x) | |
x.__iter__() <==> iter(x) | |
x.__le__(y) <==> x<=y | |
x.__len__() <==> len(x) | |
x.__lt__(y) <==> x<y | |
x.__ne__(y) <==> x!=y | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
x.__repr__() <==> repr(x) | |
x.__setitem__(i, y) <==> x[i]=y | |
D.clear() -> None. | |
D.copy() -> a shallow copy of D | |
D.has_key(k) -> True if D has a key k, else False | |
D.items() -> list of D's (key, value) pairs, as 2-tuples | |
D.iteritems() -> an iterator over the (key, value) items of D | |
D.iterkeys() -> an iterator over the keys of D | |
D.itervalues() -> an iterator over the values of D | |
D.keys() -> list of D's keys | |
If key is not found, d is returned if given, otherwise KeyError is raised | |
2-tuple; but raise KeyError if D is empty | |
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D | |
D.update(E) -> None. | |
D.values() -> list of D's values | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
Inherited from type | |
v defaults to None. |
Instance Variable Summary | |
---|---|
instance of Key |
key : the key of the record, unique over the whole database. |
Method Details |
---|
add(self, field, value, constructor=None)Adds a new value to a field of this record. This function allows you to add an item to a record. It converts the specified 'value' by calling 'constructor' on it, and appends the resulting attribute to the record. If you specify something like 'a.b' in fields, the 'b' qualifier for field 'a' is set, for the last 'a' added. It is possible, if you know that you will only have one 'a', to set 'a.b' before 'a'. Example:
>>> rec.add ('title', u'My title', Attribute.Text)
>>> rec.add ('title.subtitle', u'My subtitle', Attribute.Text)
>>> rec.add ('author', definition, author_parser)
|
get(self, key, default=None)Get a field, understanding the dotted notation of theadd method
|
xmlwrite(self, fd, offset=1)Export as XML. Writes the content of the record as an XML fragment.
|
Instance Variable Details |
---|
keythe key of the record, unique over the whole database. It is generated by the actual storage layer.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Wed Feb 15 23:19:37 2006 | http://epydoc.sf.net |