def from_hash(self, obj):
     """Convert the hash into the object."""
     super(CitationProposal, self).from_hash(obj)
     if 'citation_id' in obj:
         self.citation = Citations.get(Citations.id == obj['citation_id'])
     if 'proposal_id' in obj:
         self.proposal = Proposals.get(Proposals.id == obj['proposal_id'])
 def from_hash(self, obj):
     """Convert the hash into the object."""
     super(ProposalParticipant, self).from_hash(obj)
     if 'person_id' in obj:
         self.person = Users.get(Users.id == obj['person_id'])
     if 'proposal_id' in obj:
         self.proposal = Proposals.get(Proposals.id == obj['proposal_id'])
 def from_hash(self, obj):
     """Convert the hash into the object."""
     super(AToolProposal, self).from_hash(obj)
     if 'proposal_id' in obj:
         self.proposal = Proposals.get(Proposals.id == obj['proposal_id'])
     if 'analytical_tool_id' in obj:
         self.analytical_tool = AnalyticalTools.get(
             AnalyticalTools.id == obj['analytical_tool_id'])
 def from_hash(self, obj):
     """Convert the hash into the object."""
     super(ProposalInstrument, self).from_hash(obj)
     if 'instrument_id' in obj:
         self.instrument = Instruments.get(
             Instruments.id == obj['instrument_id'])
     if 'proposal_id' in obj:
         self.proposal = Proposals.get(Proposals.id == obj['proposal_id'])
 def from_hash(self, obj):
     """
     Converts the hash into the object
     """
     super(CitationProposal, self).from_hash(obj)
     if 'citation_id' in obj:
         self.citation = Citations.get(Citations.id == obj['citation_id'])
     if 'proposal_id' in obj:
         self.proposal = Proposals.get(Proposals.id == obj['proposal_id'])
 def from_hash(self, obj):
     """
     Converts the hash into the object
     """
     super(ProposalParticipant, self).from_hash(obj)
     if 'person_id' in obj:
         self.person = Users.get(Users.id == obj['person_id'])
     if 'proposal_id' in obj:
         self.proposal = Proposals.get(Proposals.id == obj['proposal_id'])
 def from_hash(self, obj):
     """
     Converts the hash into the object
     """
     super(ProposalInstrument, self).from_hash(obj)
     if 'instrument_id' in obj:
         self.instrument = Instruments.get(Instruments.id == obj['instrument_id'])
     if 'proposal_id' in obj:
         self.proposal = Proposals.get(Proposals.id == obj['proposal_id'])
 def where_clause(self, kwargs):
     """Where clause for the various elements."""
     where_clause = super(CitationProposal, self).where_clause(kwargs)
     if 'citation_id' in kwargs:
         citation = Citations.get(Citations.id == kwargs['citation_id'])
         where_clause &= Expression(CitationProposal.citation, OP.EQ, citation)
     if 'proposal_id' in kwargs:
         proposal = Proposals.get(Proposals.id == kwargs['proposal_id'])
         where_clause &= Expression(CitationProposal.proposal, OP.EQ, proposal)
     return where_clause
 def where_clause(self, kwargs):
     """
     Where clause for the various elements.
     """
     where_clause = super(CitationProposal, self).where_clause(kwargs)
     if 'citation_id' in kwargs:
         citation = Citations.get(Citations.id == kwargs['citation_id'])
         where_clause &= Expression(CitationProposal.citation, OP.EQ, citation)
     if 'proposal_id' in kwargs:
         proposal = Proposals.get(Proposals.id == kwargs['proposal_id'])
         where_clause &= Expression(CitationProposal.proposal, OP.EQ, proposal)
     return where_clause
 def where_clause(self, kwargs):
     """Where clause for the various elements."""
     where_clause = super(ProposalParticipant, self).where_clause(kwargs)
     if 'person_id' in kwargs:
         member = Users.get(Users.id == kwargs['person_id'])
         where_clause &= Expression(ProposalParticipant.person, OP.EQ,
                                    member)
     if 'proposal_id' in kwargs:
         proposal = Proposals.get(Proposals.id == kwargs['proposal_id'])
         where_clause &= Expression(ProposalParticipant.proposal, OP.EQ,
                                    proposal)
     return where_clause
 def where_clause(self, kwargs):
     """
     Where clause for the various elements.
     """
     where_clause = super(ProposalParticipant, self).where_clause(kwargs)
     if 'person_id' in kwargs:
         member = Users.get(Users.id == kwargs['person_id'])
         where_clause &= Expression(ProposalParticipant.person, OP.EQ, member)
     if 'proposal_id' in kwargs:
         proposal = Proposals.get(Proposals.id == kwargs['proposal_id'])
         where_clause &= Expression(ProposalParticipant.proposal, OP.EQ, proposal)
     return where_clause
 def where_clause(self, kwargs):
     """Where clause for the various elements."""
     where_clause = super(AToolProposal, self).where_clause(kwargs)
     if 'proposal_id' in kwargs:
         prop = Proposals.get(Proposals.id == kwargs['proposal_id'])
         where_clause &= Expression(AToolProposal.proposal, OP.EQ, prop)
     if 'analytical_tool_id' in kwargs:
         atool = AnalyticalTools.get(
             AnalyticalTools.id == kwargs['analytical_tool_id'])
         where_clause &= Expression(AToolProposal.analytical_tool, OP.EQ,
                                    atool)
     return where_clause
 def where_clause(self, kwargs):
     """
     Where clause for the various elements.
     """
     where_clause = super(ProposalInstrument, self).where_clause(kwargs)
     if 'instrument_id' in kwargs:
         instrument = Instruments.get(Instruments.id == kwargs['instrument_id'])
         where_clause &= Expression(ProposalInstrument.instrument, OP.EQ, instrument)
     if 'proposal_id' in kwargs:
         proposal = Proposals.get(Proposals.id == kwargs['proposal_id'])
         where_clause &= Expression(ProposalInstrument.proposal, OP.EQ, proposal)
     return where_clause
 def where_clause(self, kwargs):
     """Where clause for the various elements."""
     where_clause = super(ProposalInstrument, self).where_clause(kwargs)
     if 'instrument_id' in kwargs:
         instrument = Instruments.get(
             Instruments.id == kwargs['instrument_id'])
         where_clause &= Expression(ProposalInstrument.instrument, OP.EQ,
                                    instrument)
     if 'proposal_id' in kwargs:
         proposal = Proposals.get(Proposals.id == kwargs['proposal_id'])
         where_clause &= Expression(ProposalInstrument.proposal, OP.EQ,
                                    proposal)
     return where_clause
 def from_hash(self, obj):
     """Convert the hash into the object."""
     super(Transactions, self).from_hash(obj)
     if '_id' in obj:
         # pylint: disable=invalid-name
         self.id = int(obj['_id'])
         # pylint: enable=invalid-name
     if 'submitter' in obj:
         self.submitter = Users.get(Users.id == obj['submitter'])
     if 'instrument' in obj:
         self.instrument = Instruments.get(Instruments.id == obj['instrument'])
     if 'proposal' in obj:
         self.proposal = Proposals.get(Proposals.id == obj['proposal'])
 def where_clause(self, kwargs):
     """Where clause for the various elements."""
     where_clause = super(Transactions, self).where_clause(kwargs)
     if '_id' in kwargs:
         where_clause &= Expression(Transactions.id, OP.EQ, kwargs['_id'])
     if 'submitter' in kwargs:
         user = Users.get(Users.id == kwargs['submitter'])
         where_clause &= Expression(Transactions.submitter, OP.EQ, user)
     if 'instrument' in kwargs:
         inst = Instruments.get(Instruments.id == kwargs['instrument'])
         where_clause &= Expression(Transactions.instrument, OP.EQ, inst)
     if 'proposal' in kwargs:
         prop = Proposals.get(Proposals.id == kwargs['proposal'])
         where_clause &= Expression(Transactions.proposal, OP.EQ, prop)
     return where_clause
 def from_hash(self, obj):
     """
     Converts the hash into the object
     """
     super(Transactions, self).from_hash(obj)
     if '_id' in obj:
         # pylint: disable=invalid-name
         self.id = int(obj['_id'])
         # pylint: enable=invalid-name
     if 'submitter' in obj:
         self.submitter = Users.get(Users.id == obj['submitter'])
     if 'instrument' in obj:
         self.instrument = Instruments.get(Instruments.id == obj['instrument'])
     if 'proposal' in obj:
         self.proposal = Proposals.get(Proposals.id == obj['proposal'])
 def where_clause(self, kwargs):
     """
     Where clause for the various elements.
     """
     where_clause = super(Transactions, self).where_clause(kwargs)
     if '_id' in kwargs:
         where_clause &= Expression(Transactions.id, OP.EQ, kwargs['_id'])
     if 'submitter' in kwargs:
         user = Users.get(Users.id == kwargs['submitter'])
         where_clause &= Expression(Transactions.submitter, OP.EQ, user)
     if 'instrument' in kwargs:
         inst = Instruments.get(Instruments.id == kwargs['instrument'])
         where_clause &= Expression(Transactions.instrument, OP.EQ, inst)
     if 'proposal' in kwargs:
         prop = Proposals.get(Proposals.id == kwargs['proposal'])
         where_clause &= Expression(Transactions.proposal, OP.EQ, prop)
     return where_clause