def from_hash(self, obj): """Convert the hash to the object.""" super(TransactionRelease, self).from_hash(obj) self._set_only_if( 'transaction', obj, 'transaction', lambda: Transactions.get(Transactions.id == obj['transaction'])) self._set_only_if( 'authorized_person', obj, 'authorized_person', lambda: Users.get(Users.id == obj['authorized_person']))
def from_hash(self, obj): """Convert the hash into the object.""" super(AToolTransaction, self).from_hash(obj) self._set_only_if( 'analytical_tool_id', obj, 'analytical_tool', lambda: AnalyticalTools.get(AnalyticalTools.id == obj[ 'analytical_tool_id'])) self._set_only_if( 'transaction_id', obj, 'transaction', lambda: Transactions.get(Transactions.id == obj['transaction_id']))
def from_hash(self, obj): """Convert the hash into the object.""" super(TransactionKeyValue, self).from_hash(obj) self._set_only_if( 'transaction_id', obj, 'transaction', lambda: Transactions.get(Transactions.id == obj['transaction_id']) ) self._set_only_if( 'value_id', obj, 'value', lambda: Values.get( Values.id == obj['value_id']) ) self._set_only_if( 'key_id', obj, 'key', lambda: Keys.get(Keys.id == obj['key_id']) )
def trans_func(): """Return the transaction for the obj id.""" return Transactions.get(Transactions.id == obj['transaction_id'])