def from_hash(self, obj): """Convert the hash into the object.""" super(InstrumentCustodian, self).from_hash(obj) if 'instrument_id' in obj: self.instrument = Instruments.get(Instruments.id == obj['instrument_id']) if 'custodian_id' in obj: self.custodian = Users.get(Users.id == obj['custodian_id'])
def from_hash(self, obj): """Convert the hash into the object.""" super(InstrumentGroup, self).from_hash(obj) if 'instrument_id' in obj: self.instrument = Instruments.get( Instruments.id == obj['instrument_id']) if 'group_id' in obj: self.group = Groups.get(Groups.id == obj['group_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(InstrumentCustodian, self).from_hash(obj) if 'instrument_id' in obj: self.instrument = Instruments.get(Instruments.id == obj['instrument_id']) if 'person_id' in obj: self.custodian = Users.get(Users.id == obj['person_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 from_hash(self, obj): """ Converts the hash into the object """ super(InstrumentGroup, self).from_hash(obj) if 'instrument_id' in obj: self.instrument = Instruments.get(Instruments.id == obj['instrument_id']) if 'group_id' in obj: self.group = Groups.get(Groups.id == obj['group_id'])
def where_clause(self, kwargs): """Where clause for the various elements.""" where_clause = super(InstrumentCustodian, self).where_clause(kwargs) if 'instrument_id' in kwargs: instrument = Instruments.get(Instruments.id == kwargs['instrument_id']) where_clause &= Expression(InstrumentCustodian.instrument, OP.EQ, instrument) if 'custodian_id' in kwargs: user = Users.get(Users.id == kwargs['custodian_id']) where_clause &= Expression(InstrumentCustodian.custodian, OP.EQ, user) return where_clause
def where_clause(self, kwargs): """Where clause for the various elements.""" where_clause = super(InstrumentGroup, self).where_clause(kwargs) if 'instrument_id' in kwargs: instrument = Instruments.get( Instruments.id == kwargs['instrument_id']) where_clause &= Expression(InstrumentGroup.instrument, OP.EQ, instrument) if 'group_id' in kwargs: group = Groups.get(Groups.id == kwargs['group_id']) where_clause &= Expression(InstrumentGroup.group, OP.EQ, group) return where_clause
def where_clause(self, kwargs): """ Where clause for the various elements. """ where_clause = super(InstrumentCustodian, self).where_clause(kwargs) if 'instrument_id' in kwargs: instrument = Instruments.get(Instruments.id == kwargs['instrument_id']) where_clause &= Expression(InstrumentCustodian.instrument, OP.EQ, instrument) if 'person_id' in kwargs: user = Users.get(Users.id == kwargs['person_id']) where_clause &= Expression(InstrumentCustodian.custodian, OP.EQ, user) 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(InstrumentGroup, self).where_clause(kwargs) if 'instrument_id' in kwargs: instrument = Instruments.get(Instruments.id == kwargs['instrument_id']) where_clause &= Expression(InstrumentGroup.instrument, OP.EQ, instrument) if 'group_id' in kwargs: group = Groups.get(Groups.id == kwargs['group_id']) where_clause &= Expression(InstrumentGroup.group, OP.EQ, group) 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(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(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