def from_hash(self, obj): """Convert the hash to the object.""" super(CitationDOI, self).from_hash(obj) self._set_only_if( 'citation', obj, 'citation', lambda: Citations.get(Citations.id == obj['citation'])) self._set_only_if('doi', obj, 'doi', lambda: DOIEntries.get(DOIEntries.doi == obj['doi']))
def from_hash(self, obj): """Convert the hash into the object.""" super(CitationProposal, self).from_hash(obj) self._set_only_if( 'citation_id', obj, 'citation', lambda: Citations.get(Citations.id == obj['citation_id'])) self._set_only_if( 'proposal_id', obj, 'proposal', lambda: Proposals.get(Proposals.id == obj['proposal_id']))
def from_hash(self, obj): """Convert the hash to the object.""" super(CitationTransaction, self).from_hash(obj) self._set_only_if( 'citation', obj, 'citation', lambda: Citations.get(Citations.id == obj['citation'])) self._set_only_if( 'transaction', obj, 'transaction', lambda: TransactionRelease.get( TransactionRelease.transaction == obj['transaction']))
def from_hash(self, obj): """Convert the hash into the object.""" super(CitationKeyword, self).from_hash(obj) self._set_only_if( 'citation_id', obj, 'citation', lambda: Citations.get(Citations.id == obj['citation_id'])) self._set_only_if( 'keyword_id', obj, 'keyword', lambda: Keywords.get(Keywords.id == obj['keyword_id']))
def from_hash(self, obj): """Convert the hash into the object.""" super(CitationContributor, self).from_hash(obj) self._set_only_if( 'citation_id', obj, 'citation', lambda: Citations.get(Citations.id == obj['citation_id'])) self._set_only_if( 'author_id', obj, 'author', lambda: Contributors.get(Contributors.id == obj['author_id'])) self._set_only_if('author_precedence', obj, 'author_precedence', lambda: int(obj['author_precedence']))
def base_create_dep_objs(cls): """Create all objects that Files depend on.""" keyword = Keywords() TestKeywords.base_create_dep_objs() keyword.from_hash(SAMPLE_KEYWORD_HASH) keyword.save(force_insert=True) cite1 = Citations() TestCitations.base_create_dep_objs() cite1.from_hash(SAMPLE_CITATION_HASH) cite1.save(force_insert=True)
def base_create_dep_objs(cls): """Create all objects that Files depend on.""" cite1 = Citations() TestCitations.base_create_dep_objs() cite1.from_hash(SAMPLE_CITATION_HASH) cite1.save(force_insert=True) contrib = Contributors() TestContributors.base_create_dep_objs() contrib.from_hash(SAMPLE_CONTRIBUTOR_HASH) contrib.save(force_insert=True)
def base_create_dep_objs(cls): """Build the object and make dependent user object.""" cite = Citations() TestCitations.base_create_dep_objs() cite.from_hash(SAMPLE_CITATION_HASH) cite.save(force_insert=True) trans_rel = TransactionUser() TestTransactionUser.base_create_dep_objs() trans_rel.from_hash(SAMPLE_TRANS_USER_HASH) trans_rel.save(force_insert=True)
def base_create_dep_objs(cls): """Create all objects that FileKeyValue need.""" prop1 = Proposals() TestProposals.base_create_dep_objs() prop1.from_hash(SAMPLE_PROPOSAL_HASH) prop1.save(force_insert=True) cite = Citations() TestCitations.base_create_dep_objs() cite.from_hash(SAMPLE_CITATION_HASH) cite.save(force_insert=True)
def base_create_dep_objs(cls): """Build the object and make dependent user object.""" doi = DOIEntries() TestDOIEntries.base_create_dep_objs() doi.from_hash(SAMPLE_DOIENTRIES_HASH) doi.save(force_insert=True) cite = Citations() TestCitations.base_create_dep_objs() cite.from_hash(SAMPLE_CITATION_HASH) cite.save(force_insert=True)