Show
Ignore:
Timestamp:
10/18/09 21:40:10 (3 years ago)
Author:
mauro
Message:

* rebuild catalog action on biosqlroot's view and triggered by modify event
* choice seqrecord key field (fix #6)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plone4bio.biosql/trunk/src/plone4bio/biosql/content/seqrecord.py

    r62 r112  
    9595        # from stxnext import pdb;pdb.set_trace() 
    9696        if self._v_seqrecord is None or reload: 
    97             self._v_seqrecord = self._getBiodatabase().getDatabase()[self.id] 
     97            if self.getBioSQLRoot().seqrecord_key == 'accession': 
     98                self._v_seqrecord = self._getBiodatabase().getDatabase().get_Seq_by_acc(self.id) 
     99            elif self.getBioSQLRoot().seqrecord_key == 'version': 
     100                self._v_seqrecord = self._getBiodatabase().getDatabase().get_Seq_by_ver(self.id) 
     101            else: # default = 'bioentry_id': 
     102                self._v_seqrecord = self._getBiodatabase().getDatabase()[self.id] 
     103            logger.debug("%s -> %r" % (self.id, self._v_seqrecord)) 
    98104        return self._v_seqrecord 
    99105