Package Pyblio :: Module Adapter :: Class OneToOneAdapter
[hide private]
[frames] | no frames]

Class OneToOneAdapter

source code

    object --+        
             |        
Store.Database --+    
                 |    
           Adapter --+
                     |
                    OneToOneAdapter
Known Subclasses:
Adapters.WOK2BibTeX.WOK2BibTeX, Adapters.PubMed2BibTeX.PubMed2BibTeX

This adapter assumes a one-to-one mapping between the source and the target databases. The keys are not modified.

Instance Methods [hide private]
 
__init__(self, base) source code
 
source2target(self, record)
Translates a record from the source db to the target db
source code
 
target2source(self, record)
Translates a record from the target db to the source db
source code
 
add(self, record)
Insert a new entry in the database.
source code
 
__setitem__(self, key, record)
Update a record.
source code
 
__getitem__(self, key)
Get a record by key.
source code
 
has_key(self, key)
Check for the existence of a key.
source code
 
_entries(self) source code

Inherited from Adapter: save, xmlread

Inherited from Store.Database: collate, query, validate, xmlwrite

Inherited from Store.Database (private): _entries_get, _txo_get, _txo_warn

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]

Inherited from Adapter: header

Inherited from Store.Database: rs

Properties [hide private]
  entries
a resultset containing all the records of the database.

Inherited from Store.Database: txo

Inherited from object: __class__

Method Details [hide private]

__init__(self, base)
(Constructor)

source code 
Overrides: Adapter.__init__

add(self, record)

source code 

Insert a new entry in the database.

New entries MUST be added with this method, not via an update with a hand-made Key.
Overrides: Store.Database.add
(inherited documentation)

__setitem__(self, key, record)
(Index assignment operator)

source code 

Update a record.

Updates a record with a new value.
Overrides: Store.Database.__setitem__
(inherited documentation)

__getitem__(self, key)
(Indexing operator)

source code 
Get a record by key.
Overrides: Store.Database.__getitem__
(inherited documentation)

has_key(self, key)

source code 
Check for the existence of a key.
Overrides: Store.Database.has_key
(inherited documentation)

Property Details [hide private]

entries

a resultset containing all the records of the database.
Get Method:
Pyblio.Adapter.OneToOneAdapter._entries(self)